I'm using nconvert to convert from a TIFF image to a jpeg. Everything goes fine but colors are inverted.
Any idea ?
Here's the command line I use :
nconvert.exe -out jpeg -resize 640 480 -ratio "MY SIZE Plain_must_have_Cassis 033 - 6836+39 shorty Laura.tif"
TIFF conversion result in a color invertion
Moderators: helmut, XnTriq, xnview
Re: TIFF conversion result in a color invertion
Could you post your tif file?Marvin256 wrote:I'm using nconvert to convert from a TIFF image to a jpeg. Everything goes fine but colors are inverted.
Any idea ?
Here's the command line I use :
nconvert.exe -out jpeg -resize 640 480 -ratio "MY SIZE Plain_must_have_Cassis 033 - 6836+39 shorty Laura.tif"
Pierre.
Thank you for your help
You'll find the TIFF file here : http://www.serial-skier.com/MY_SIZE_Pla ... _Laura.tif
Regards
You'll find the TIFF file here : http://www.serial-skier.com/MY_SIZE_Pla ... _Laura.tif
Regards
Marvin256,Marvin256 wrote:Thank you for your help
You'll find the TIFF file here :
http://www.serial-skier.com/MY_SIZE_Pla ... _Laura.tif
Regards
Both Nconvert and XnView crashed when I tried to open up your TIF file. However,
Irfanview did not have a problem and was able to convert it to a JPG that did not
have inverted colors when viewed in XnView or Irfanview.
Curious as to why XnView would not open it, I noticed the
following information for the TIF file in the XnView preview:
Number of Planes: 1
Bits Per Plane: 24
Other info: LZW, CMYK
I opened up that TIF file with GIMP and I got the following message:
"alpha channel type not defined for file
MY_SIZE_Plain_must_have_Cassis_033_-_6836+39_shorty_Laura.tif.
Assuming alpha is not premultiplied"
I saved that file as a TIF in two different ways, one with the option
"Save color values from transparent pixels" and one without (both with
LZW compression).
These newly created TIFs could now be opened with XnView and converted to JPG with no
inversion of colors (viewed in XnView and Irfanview). Same was also true for Nconvert.
XnView showed the following info. for these 2 new TIFs:
Number of Planes: 1
Bits Per Plane: 32
Other info: LZW, RGB
I take a guess that the answer as to why your JPG image is inverted probably has
something to do with your TIF being 24 BPP in conjunction with CMYK.
Hope this helps!
Marv
A follow up to my previous post ...
My observations were based on the previous versions of XnView and Nconvert. I just downloaded the new versions and find that the original TIF can now be opened with XnView, but the colors are inverted! When saved to JPG, the colors remain inverted (viewed in Irfanview and XnView). The 2 TIFs created from the original TIF using GIMP can be opened with XnView and do not suffer from any color inversion.
I then used Nconvert to convert the original TIF to a TIF. The resulting TIF had the colors reversed (when viewed in Irfanview and XnView) and running Nconvert on that TIF did not invert the inverted colors! Out of curiosity, I wondered if the LZW compression had something to do with it. I repeated the experiment again with an uncompressed TIF (using Irfanview, NOT XnView, to generate the uncompressed TIF) and found that Nconvert no longer inverted the colors. Same was true for XnView.
Using that uncompressed TIF, I was able to correctly convert the TIF to a resized JPG with Nconvert. I repeated the same experiment using TIFs made with the different compressions available (zip and packbit) and had no problems with Nconvert or XnView. HOWEVER, when I compressed the TIF file with LZW (using the LZW as well as the LZW plus predictive), the resulting TIFs were NOT problems for Nconvert or XnView.
Since that made no sense to me, I went back to the original TIF and this time used XnView to generate an uncompressed TIF. When I attempted to do so, I got a warning that doing so might cause some loss of data (I ignored the warning). That newly generated TIF still had colors inverted when viewed in XnView, but now the colors also appeared inverted in Irfanview!
My new guess is that the information that was supposedly lost when XnView converted the compressed TIF to an uncompressed TIF is information that Irfanview makes use of in order to correctly render the image, but XnView ignores or doesn't interpret correctly.
OK, that does it for me ... I enjoyed the hunt!
Marv
My observations were based on the previous versions of XnView and Nconvert. I just downloaded the new versions and find that the original TIF can now be opened with XnView, but the colors are inverted! When saved to JPG, the colors remain inverted (viewed in Irfanview and XnView). The 2 TIFs created from the original TIF using GIMP can be opened with XnView and do not suffer from any color inversion.
I then used Nconvert to convert the original TIF to a TIF. The resulting TIF had the colors reversed (when viewed in Irfanview and XnView) and running Nconvert on that TIF did not invert the inverted colors! Out of curiosity, I wondered if the LZW compression had something to do with it. I repeated the experiment again with an uncompressed TIF (using Irfanview, NOT XnView, to generate the uncompressed TIF) and found that Nconvert no longer inverted the colors. Same was true for XnView.
Using that uncompressed TIF, I was able to correctly convert the TIF to a resized JPG with Nconvert. I repeated the same experiment using TIFs made with the different compressions available (zip and packbit) and had no problems with Nconvert or XnView. HOWEVER, when I compressed the TIF file with LZW (using the LZW as well as the LZW plus predictive), the resulting TIFs were NOT problems for Nconvert or XnView.
Since that made no sense to me, I went back to the original TIF and this time used XnView to generate an uncompressed TIF. When I attempted to do so, I got a warning that doing so might cause some loss of data (I ignored the warning). That newly generated TIF still had colors inverted when viewed in XnView, but now the colors also appeared inverted in Irfanview!
My new guess is that the information that was supposedly lost when XnView converted the compressed TIF to an uncompressed TIF is information that Irfanview makes use of in order to correctly render the image, but XnView ignores or doesn't interpret correctly.
OK, that does it for me ... I enjoyed the hunt!
Marv
It decodes badly in XNview 
When converting into BMP using NC, it indeed gets inverted ... but "-negate" seems to fix it
TIF is a messy image format
... better to use BMP for uncompressed and PNG for compressed images 
Also your TIF has 65 MiB of raw 3x8bpp data ... dangerously approaches NC's (?) limits.
Your TIF wrote:


When converting into BMP using NC, it indeed gets inverted ... but "-negate" seems to fix it

TIF is a messy image format


Also your TIF has 65 MiB of raw 3x8bpp data ... dangerously approaches NC's (?) limits.
Your TIF wrote:
Get it ^^^ and retry with some smaller TIF's if you need the full truthAdobe Photoshop CS3 Macintosh 2007

Not true, the colors are washed out:NTOSKRNL_VXE wrote:
When converting into BMP using NC, it indeed gets inverted ... but "-negate" seems to fix it![]()

Yes Tifs can be tricky, but they seem to be favored by photographers (based on what someone posted in this forum).TIF is a messy image format... better to use BMP for uncompressed and PNG for compressed images
I'm not a photographer, but I deal with TIFs whenever I do conversions of printed material into DjVu. So I'm certainly no
stranger to TIFs with inverted colors!

Marv