-fill +opaque operator alters size of image (MB)

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
inwelkin@gmail.com
Posts: 8
Joined: 2015-03-13T14:35:09-07:00
Authentication code: 6789

-fill +opaque operator alters size of image (MB)

Post by inwelkin@gmail.com »

Hi,

I have a 140MB old.tif image, with 24 bit color depth. I used -fill +opaque operators to change one particular color in the image to a new one, and exported the resulting image new.tif. I saw two strange things:
(1) new.tif is 464MB, much bigger than old.tif. Why would this happen?
(2) new.tif is obviously also 24 bit in color depth. However, using -depth 8 on it is ineffective. The operation still yields a 24 bit image.
Please advice. These are both undesirable events for downstream processing...
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: -fill +opaque operator alters size of image (MB)

Post by snibgo »

What are the compression methods on the before and after files? "identify -verbose" will tell you. Perhaps the before file had jpeg compression, which was removed, because the default is not to lose data. Or perhaps you introduced a new colour, so a palette could no longer be used.

"-depth 8" means 8 bits/channel/pixel. There are 3 channels.
snibgo's IM pages: im.snibgo.com
inwelkin@gmail.com
Posts: 8
Joined: 2015-03-13T14:35:09-07:00
Authentication code: 6789

Re: -fill +opaque operator alters size of image (MB)

Post by inwelkin@gmail.com »

You are right. Old image has packbits compression. Removed in new image. Thank you!
Post Reply