Page 1 of 1

Conversion with Blending Layer Issues (tif to jpg)

Posted: 2017-02-09T08:20:31-07:00
by cazter
The below #1 argument has worked for thousands of images but recently tif files containing a blending layer have resulted in the following issue:

Original file: https://www.dropbox.com/s/iazfiswmn6yu8 ... 7.tif?dl=0

PNG preview of original:
Image


#1 Failed Conversion Argument: -quality 85 -flatten
Image

#2 Failed Conversion Argument: -quality 85 -layers merge
Image

#3 Failed Conversion Argument: -alpha off/deactivate -quality 85 -layers merge
Image

#4 Failed Conversion Argument: -alpha remove -background white -quality 85
Image

This last one, #4, is about what we're looking for minus the black background (sometimes dark grey background). Grateful for any suggestions on how we might make the #4 argument produce a white background. Or even better, an adjustment to the original argument #1, that works.

Re: Conversion with Blending Layer Issues (tif to jpg)

Posted: 2017-02-09T09:02:20-07:00
by snibgo
The file contains three images, of different sizes. I suppose you want only the first image, and don't want to flatten them together.

Code: Select all

convert "Aviator_Brown Gold_Mic 3_Snake&S6AVFM-157.tif"[0] x.png
Does that do what you want?

Re: Conversion with Blending Layer Issues (tif to jpg)

Posted: 2017-02-09T09:06:18-07:00
by cazter
Ignore the different sizes. The different images are the outcomes of the various conversion arguments we tried on the original file.

Re: Conversion with Blending Layer Issues (tif to jpg)

Posted: 2017-02-09T11:24:32-07:00
by fmw42
What is your IM version and platform/OS, since syntax may vary. Please always provide that.

What were your exact full command lines?

Re: Conversion with Blending Layer Issues (tif to jpg)

Posted: 2017-02-09T12:40:15-07:00
by cazter
fmw42 wrote: 2017-02-09T11:24:32-07:00 What is your IM version and platform/OS, since syntax may vary. Please always provide that.

What were your exact full command lines?
Version: 7.0.1

Commands:
  • 1. convert -quality 85 -flatten file.tif -resize 2400x2400 file.jpg
  • 2. convert -quality 85 -layers merge file.tif -resize 2400x2400 file.jpg
  • 3. convert -alpha off/deactivate -quality 85 -layers merge file.tif -resize 2400x2400 file.jpg
  • 4. convert -alpha remove -background white -quality 85 file.tif -resize 2400x2400 file.jpg

Re: Conversion with Blending Layer Issues (tif to jpg)

Posted: 2017-02-09T12:55:09-07:00
by fmw42
Your syntax is wrong. Put the input image right after convert. Also you did not say what platform you are on.

JPG output does not support transparency. Try saving to PNG. Or flatten against a white background.

Re: Conversion with Blending Layer Issues (tif to jpg)

Posted: 2017-02-09T13:02:53-07:00
by fmw42
try

Code: Select all

convert -quiet "Aviator_Brown Gold_Mic 3_Snake&S6AVFM-157.tif" -background none -flatten test.png
or

Code: Select all

convert -quiet "Aviator_Brown Gold_Mic 3_Snake&AVFM-157.tif" -background white -flatten -quality 85 test.jpg

Re: Conversion with Blending Layer Issues (tif to jpg)

Posted: 2017-02-09T13:04:41-07:00
by cazter
fmw42 wrote: 2017-02-09T12:55:09-07:00 Your syntax is wrong. Put the input image right after convert. Also you did not say what platform you are on.

JPG output does not support transparency. Try saving to PNG. Or flatten against a white background.
Platform Windows Server 2012

We have a GUI in front of the convert.exe that places the file names in the correct spots, but otherwise doesn't impact/alter the arguments. What I typed above was my best guess at how it's structuring the full commands as the GUI only provides us options to supply the arguments.

But I feel like this is all beside the point... the conversions process, it's the arguments were supplying and the above image results that are the issue.

Re: Conversion with Blending Layer Issues (tif to jpg)

Posted: 2017-02-09T13:07:33-07:00
by fmw42
Try my commands above. And note that JPG does not support transparency, so you need to choose a color or it will default to black. If my commands do not produce the correct results for you, please let me know what is incorrect.

You may need to change your GUI, if it is not reading the input image in the correct location in your command line.

Re: Conversion with Blending Layer Issues (tif to jpg)

Posted: 2017-02-09T13:10:11-07:00
by cazter
fmw42 wrote: 2017-02-09T13:02:53-07:00 try

Code: Select all

convert -quiet "Aviator_Brown Gold_Mic 3_Snake&S6AVFM-157.tif" -background none -flatten test.png
or

Code: Select all

convert -quiet "Aviator_Brown Gold_Mic 3_Snake&AVFM-157.tif" -background white -flatten -quality 85 test.jpg
Boom, these both work! Genuinely surprised we were able to get help with this. Very grateful, thank you. If you want some headphones/earbuds from one of our companies skullcandy/astrogaming, PM me and I'll make it happen.

Thanks again

Re: Conversion with Blending Layer Issues (tif to jpg)

Posted: 2017-02-09T13:12:56-07:00
by fmw42
The other issue is that your TIFF is CMYKA. That is probably why your images look reversed. You would be better off convert them to RGB for your output using profiles to get the best results.

Re: Conversion with Blending Layer Issues (tif to jpg)

Posted: 2017-02-09T13:13:34-07:00
by fmw42
I am surprised that PNG works, since it does not support CMYK colorspace.

EDIT: It looks like IM was smart enough to convert the result to sRGB before saving to PNG.

Re: Conversion with Blending Layer Issues (tif to jpg)

Posted: 2017-02-09T13:17:53-07:00
by fmw42
If you want to convert to sRGB (since many viewers to not properly view CMYK, especially without a profile), then try (unix syntax)

Code: Select all

   
convert -quiet "Aviator_Brown Gold_Mic 3_Snake&S6AVFM-157.tif" \
-profile /Users/fred/images/profiles/USWebCoatedSWOP.icc \
-profile /Users/fred/images/profiles/sRGB.icc \
-background white -flatten -quality 85 test.jpg
For Windows replace newline symbol \ with ^ And use your own paths to your profiles.

Re: Conversion with Blending Layer Issues (tif to jpg)

Posted: 2017-02-09T13:54:19-07:00
by cazter
We are actually having some color issues with some of our conversions. PM'ed you.