Broken gradients
-
- Posts: 24
- Joined: 2018-06-17T12:09:46-07:00
- Authentication code: 1152
Broken gradients
Hi, When ImageMagic converts an EPS file to JPEG that has a gradient to 300 DPI, the gradients breakup. Please see sample attached. Your help would be highly appreciated. Thanks!
https://postimg.cc/image/eghx94ptt/
https://postimg.cc/image/eghx94ptt/
Re: Broken gradients
For a useful reply you should add these details to your post:
Your Imagemagick version
The code you are using
OS/platform
Link to the original image
Your Imagemagick version
The code you are using
OS/platform
Link to the original image
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Broken gradients
Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
For novices, see
http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
For novices, see
http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
Re: Broken gradients
I thought I had seen a similar post to this a few years ago but can't find it.
What does it look like if you save it as a png for example as jpg compression may have an effect also jpg does not has as large a range of colours.
What does it look like if you save it as a png for example as jpg compression may have an effect also jpg does not has as large a range of colours.
-
- Posts: 24
- Joined: 2018-06-17T12:09:46-07:00
- Authentication code: 1152
Re: Broken gradients
Imagemagick version: 6.8
The code we are using: PHP CLI
OS/platform: Linux
Command we use for this: convert -density 300 -colorspace sRGB converted_image.jpg sunrise.eps
Link to the original image: https://www.dropbox.com/s/edf4ty7ywogbv ... 6.eps?dl=0
Thank you very much for your help!
The code we are using: PHP CLI
OS/platform: Linux
Command we use for this: convert -density 300 -colorspace sRGB converted_image.jpg sunrise.eps
Link to the original image: https://www.dropbox.com/s/edf4ty7ywogbv ... 6.eps?dl=0
Thank you very much for your help!
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Broken gradients
That command reads a JPEG file and writes an EPS file, which is the opposite to your OP question.stockphotos wrote:convert -density 300 -colorspace sRGB converted_image.jpg sunrise.eps
If you are actually writing to a JPEG file, then JPEGs are only 8 bits/channel, which will show banding in subtle gradients. A 16 bit/channel format would be better.
snibgo's IM pages: im.snibgo.com
-
- Posts: 24
- Joined: 2018-06-17T12:09:46-07:00
- Authentication code: 1152
Re: Broken gradients
Sorry, meant to write:
convert -density 300 -colorspace sRGB xxxx.eps final.jpg
convert -density 300 -colorspace sRGB xxxx.eps final.jpg
-
- Posts: 24
- Joined: 2018-06-17T12:09:46-07:00
- Authentication code: 1152
Re: Broken gradients
how do I change it to a 16 bit channel?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Broken gradients
JPG is always 8-bit. Other formats such as PNG and TIFF can be 16-bit.
However, converting your image always makes 8-bit. I don't know why. It also uses spot colours, which won't be converted (because Ghostscript ignores them). The result also has transparency, which will be ignored when writing JPEG.
However, converting your image always makes 8-bit. I don't know why. It also uses spot colours, which won't be converted (because Ghostscript ignores them). The result also has transparency, which will be ignored when writing JPEG.
snibgo's IM pages: im.snibgo.com
-
- Posts: 24
- Joined: 2018-06-17T12:09:46-07:00
- Authentication code: 1152
Re: Broken gradients
Would you guys be so kind and help us come up with a solution?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Broken gradients
Change your output to PNG or (non-jpeg compressed) TIFF with a Q16 compile of ImageMagick. As snibgo has said JPG is 8-bit and any 8-bit output may show banding in gradients due to the limited color depth.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Broken gradients
When I download your file and examine it (identify -verbose), it shows as PDF, not EPS, even thought it has an EPS suffix. Perhaps that is the issue. If you really have an EPS file, then perhaps zip compress it and upload it again. We need to have a proper input. When I display your image, it has banding in it already.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Broken gradients
I'm not an expert on EPS (or PDF) files, but I think the banding is built into the file. It seems to be a feature of the image, not something that ImageMagick (or any software) will remove.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Broken gradients
You can mitigate the amount of banding by rendering at a higher density and then resizing. try
If you also want to convert to srgb, then
Or use 2 profiles in place of -colorspace srgb, but put them after the input image.
Code: Select all
convert -density 1200 -units pixelsperinch 74296.eps -resize 25% tmp.jpg
Code: Select all
convert -density 1200 -units pixelsperinch -colorspace sRGB 74296.eps -resize 25% tmp.jpg