Conversion with Blending Layer Issues (tif to jpg)

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
cazter
Posts: 6
Joined: 2017-02-09T07:57:17-07:00
Authentication code: 1151

Conversion with Blending Layer Issues (tif to jpg)

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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?
snibgo's IM pages: im.snibgo.com
cazter
Posts: 6
Joined: 2017-02-09T07:57:17-07:00
Authentication code: 1151

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

Post by cazter »

Ignore the different sizes. The different images are the outcomes of the various conversion arguments we tried on the original file.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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?
cazter
Posts: 6
Joined: 2017-02-09T07:57:17-07:00
Authentication code: 1151

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
cazter
Posts: 6
Joined: 2017-02-09T07:57:17-07:00
Authentication code: 1151

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

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
cazter
Posts: 6
Joined: 2017-02-09T07:57:17-07:00
Authentication code: 1151

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
cazter
Posts: 6
Joined: 2017-02-09T07:57:17-07:00
Authentication code: 1151

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

Post by cazter »

We are actually having some color issues with some of our conversions. PM'ed you.
Post Reply