Page 1 of 1

Black box instead of png in Evince

Posted: 2012-08-23T08:57:41-07:00
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.

Re: Black box instead of png in Evince

Posted: 2012-08-23T12:54:45-07:00
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?

Re: Black box instead of png in Evince

Posted: 2012-08-23T14:08:53-07:00
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.

Re: Black box instead of png in Evince

Posted: 2012-08-24T00:04:42-07:00
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