Black box instead of png in Evince

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
krilin
Posts: 2
Joined: 2012-08-23T08:44:17-07:00
Authentication code: 67789

Black box instead of png in Evince

Post by krilin »

Hi there,

This might be a newbie question but I searched for hours throughout documentation and forum without solving my problem. I use IM 6.2.8 on Unix CentOS.

I use the -shave option to remove borders of PNG files, without changing the file type. So I just basically do :

Code: Select all

convert input.png -shave 1x1 output.png
The file output.png is then included in a LaTeX source. The produced PDF shows a black box instead of output.png in Evince. However it looks nice in Acrobat Reader, and the file output.png is OK when opened with a viewer like Gthumb.

I noticed the same kind of problem with -trim option instead of -shave. All works fine when I use no option and simply do :

Code: Select all

convert input.png output.png
or when the PNG is converted to JPG with the -shave option

Code: Select all

convert input.png -shave 1x1 output.jpg
However I do not want to use JPG.
Would someone please know how to fix this ? I can of course supply more information upon request.

Many thanks

krilin

PS : I unfortunately could not update to the latest version of IM due to restricted rights.
akovia
Posts: 3
Joined: 2012-08-22T05:11:15-07:00
Authentication code: 67789

Re: Black box instead of png in Evince

Post by akovia »

Hi,
I have no idea if this will help or not but you could try the repage option.

http://www.imagemagick.org/Usage/crop/#crop_repage
Always use "+repage" after any 'crop' like operation.
Unless you actually need to preserve that info.
Maybe worth a try?
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Black box instead of png in Evince

Post by glennrp »

You should really upgrade your ImageMagick to a recent version if at all possible, or ask someone with the required rights to do so (6.7.9-0 is the current version). There were some bugs in the PNG encoder fixed inthe 6.5.x to 6.7.0 time frame that might be causing the behavior you are seeing. I don't know if those bugs existed in 6.2.8, though. Try using PNG32:output.png as the output; that might help with your old version if you truly can't upgrade.
krilin
Posts: 2
Joined: 2012-08-23T08:44:17-07:00
Authentication code: 67789

Re: Black box instead of png in Evince

Post by krilin »

Many thanks to both of you for your answers,

I tried with the +repage option, without results.
However with the PNG32 option the output file appears correctly in my final PDF... problem solved !

I will anyway follow your advice and try to have an administrator upgrade our version of ImageMagick.

Thanks again,

krilin
Post Reply