Problems Converting Toned Black And White Images

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
Pedr
Posts: 1
Joined: 2017-02-05T11:07:21-07:00
Authentication code: 1151

Problems Converting Toned Black And White Images

Post by Pedr »

I'm using ImageMagick to convert a series of toned black and white images for a website. Please could someone familiar with the capabilities of ImageMagick and indeed srgb Jpegs take a look and let me know if it is possible to get a better conversion than this.

The images are toned with a Selenium grad, giving them a slight purple hue. Inside Photoshop this looks great, but once converted, there is severe purple banding in the highlights (look at the clouds).

Here is a jpg (srgp): https://dl.dropboxusercontent.com/u/316 ... 0-Edit.jpg exported from Photoshop that doesn't show this issue.

And here is the converted image jpg (srgb): http://www.unwalked.com/photography/shack which does.

I have tried using both tifs and jpgs as the source for the conversion and tried with them as srgb and pro photo, all with the same result.

The image uploader is using MiniMagik and the version of ImageMagik is
ImageMagick 6.7.7-10 2016-11-29 Q16
The options passed are:

Code: Select all

 -auto-orient -quality 70 -strip -define jpeg:dct-method=float
along with the dimensions. I have tried removing

Code: Select all

strip
, but this made no difference.

If anyone can suggest a fix I'd really appreciate it
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problems Converting Toned Black And White Images

Post by fmw42 »

Your images are not the same size. Your original is much larger (by about 4x). If you are viewing them at the same resolution, then the other one will get enlarged probably by pixel replication. How is it that they are not the same size? Your command shows no resizing. Can you provide two same sized images for analysis?

Also I would point out that your IM version is about 200 versions old. You should consider upgrading.

Since you do not show the full command line it is hard to know what format you started with and what format you saved to. If you start with a JPG and end with a JPG, you will lose quality due to decompression and recompression using a lossy jpg compression. Also you may be using two different versions of libjpg. You should be sure they are the same.

Also using -quality 70 is going to lose more quality.

If you use -strip, you will be removing the sRGB profile in the image and it will look different. I suspect that is the source of your purple. If you do not want the other data, then use -strip, but put back the sRGB profile.

I processed your image using IM 6.9.7.7 Q16 Mac OSX with the following command and got the image below:

Code: Select all

convert Pedr-Browne-20110528-IMG_4610-Edit.jpg -define jpeg:dct-method=float -quality 70 Pedr-Browne_IM.jpg
http://www.fmwconcepts.com/misc_tests/j ... wne_IM.jpg

Do you see any purple banding?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Problems Converting Toned Black And White Images

Post by snibgo »

Pedr wrote:If anyone can suggest a fix I'd really appreciate it
I don't know what command (or multiple commands) you have used. If you showed the complete command(s), and a sample input image and the resulting output, that would help.

Typically, banding comes from using low-precision inputs, eg 8-bit/channel, and applying heavy processing. If there are multiple commands, and each intermediate stage is saved as 8-bit, the problem is made worse.
Pedr wrote:I have tried using both tifs and jpgs as the source...
Never, ever use JPEG (which is 8-bit, and usually lossy compressed) if you have anything better. It's like baking a cake with rotten eggs.

If the TIF was made from a JPEG, that won't help, because the damage is done. But if the JPEG is made from the TIF, you should use the TIF.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problems Converting Toned Black And White Images

Post by fmw42 »

TIF is ok, unless you are using JPEG compression.
Post Reply