Jpeg to transparent PNG problem

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
stevef66
Posts: 11
Joined: 2014-11-11T04:46:07-07:00
Authentication code: 6789

Jpeg to transparent PNG problem

Post by stevef66 »

Hello

I have installed ImageMagick 6.8.9-10 on a RHEL5 64bit server and am trying to convert jpeg files with clipping paths to png files with the area outside the clipping path made transparent.

The following command creates the transparent background, but parts of the area inside the original clipping path are also made transparent:
convert +clip-mask -transparent white original.jpg result.png

This command creates a png with the area outside the original clipping path opaque:
convert original.jpg -alpha transparent -clip -alpha opaque result.png

However the above command does work on another server running RHEL6 64bit with Image Magick 6.5.4-7. Unfortunately I need to get this working on the RHEL5 server. Any help would be really appreciated.

Link to file is:
https://dl.dropboxusercontent.com/u/264 ... iginal.jpg

Thanks
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Jpeg to transparent PNG problem

Post by snibgo »

Clipping paths have improved quite a lot in recent months, let alone the many years since v6.5.4.
snibgo's IM pages: im.snibgo.com
stevef66
Posts: 11
Joined: 2014-11-11T04:46:07-07:00
Authentication code: 6789

Re: Jpeg to transparent PNG problem

Post by stevef66 »

Thanks for your response, but not sure I understand you correctly.

It's working with 6.5.4-7 on RHEL 6, but not on RHEL5 with 6.8.9-10.

Would be grateful for any suggestions as to what maybe causing this.

Thanks
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Jpeg to transparent PNG problem

Post by snibgo »

I don't understand what problem you want to solve.

The command:

Code: Select all

convert original.jpg -alpha transparent -clip -alpha opaque result.png
works fine for me (IM v6.8.9-5), making the background transparent.
snibgo's IM pages: im.snibgo.com
stevef66
Posts: 11
Joined: 2014-11-11T04:46:07-07:00
Authentication code: 6789

Re: Jpeg to transparent PNG problem

Post by stevef66 »

The problem is that it doesn't work on my RHEL5 system. Have you any idea why that may be?

When the command is run I don't see any errors - missing delegates, etc. Can anyone please suggest a way of trouble shooting this?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Jpeg to transparent PNG problem

Post by fmw42 »

My guess is that it was a bug in that version and won't be fixed for that version. You will likely have to upgrade further to a version that works. You can check the changelog to see if you can find an entry where it was fixed. See http://www.imagemagick.org/script/changelog.php
stevef66
Posts: 11
Joined: 2014-11-11T04:46:07-07:00
Authentication code: 6789

Re: Jpeg to transparent PNG problem

Post by stevef66 »

Thanks for your response.

Unfortunately the problem occurs in 6.8.9-10 which is the latest version.

Is this not likely to be caused by a version of a library since it's works on RHEL6 with Image Magick version 6.5.4-7?
Post Reply