Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 28th, 2005, 01:37 PM
Registered User
 
Join Date: Apr 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Image Compression

I'm opening a tiff image that has citt group 4 compression, creating a bitmap to manipulate it and then saving the bitmap as a tiff again. The new tiff has LZ compression and I need to get it back to citt. I've since added this code to specify compression

    Dim eps As EncoderParameters = New EncoderParameters(1)
    eps.Param(0) = New EncoderParameter(System.Drawing.Imaging.Encoder.Qu ality, _
    System.Drawing.Imaging.EncoderValue.CompressionCCI TT4)
    image.Save(FileName, ici, eps)

It doesn't give me an error, but the compression is still LZ... I think I'm missing something fundamental.

 
Old April 28th, 2005, 05:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I use this Save overload:

image.Save("C:\\new1.tiff", System.Drawing.Imaging.ImageFormat.Tiff);

and it works fine. I read a bmp and save a tiff. Do you need to specify a codec?
Marco
 
Old April 29th, 2005, 08:57 PM
Registered User
 
Join Date: Apr 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Marco
Still no go... Saves as a tiff just fine, but it's still changing the compression. I added code to check the compression of the bitmap after it's manipulated and it still shows CITT4, but once saved as tiff it changes to LZ. Does yours not do this?

 
Old May 2nd, 2005, 05:11 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

take a look at this article, this is where I got my code:
http://www.devx.com/dotnet/Article/18163/0/page/3
Marco
 
Old May 19th, 2005, 03:52 PM
Registered User
 
Join Date: May 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

4wrh,

You just need to change this line to:

eps.Param(0) = New EncoderParameter(System.Drawing.Imaging.Encoder.Compression, _
    System.Drawing.Imaging.EncoderValue.CompressionCCI TT4)


 
Old May 24th, 2005, 05:39 PM
Registered User
 
Join Date: Apr 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you both...I'll stop pulling my hair out now.






Similar Threads
Thread Thread Starter Forum Replies Last Post
tiff compression sandrina C# 2005 1 December 4th, 2013 02:42 AM
Image Compression vaibhav VB How-To 1 July 3rd, 2008 06:43 AM
Compression changes on single tiff image hutchison1 Pro Visual Basic 2005 0 May 11th, 2007 03:28 PM
compression jaya_malini Java GUI 0 May 5th, 2005 10:01 AM
wav compression jothi Pro VB 6 0 April 26th, 2005 02:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.