Page 1 of 1

[resolved] Create a transparent png file

Posted: 2014-06-27T06:42:37-07:00
by Florian26
Hello,

Someone can say me how i can create a transparent png file ?
I have try with :

Code: Select all

exec('convert -size 100x100 xc:none fond.png');
exec('convert -size 100x100 -xc:none fond.png');
exec('convert -size 100x100 xc:transparent fond.png');
exec('convert -size 100x100 -xc:transparent fond.png');
exec('convert -size 100x100 -transparent fond.png')
But nothing work... i have no idea !

Thanks to your answer :)

Re: Create a transparent png file

Posted: 2014-06-27T08:18:05-07:00
by glennrp

Code: Select all

convert -size 100x100 xc:none fond.png
works for me from the commandline, using ImageMagick 6.8.9-4 Q16 x86_64 2014-06-24

Re: Create a transparent png file

Posted: 2014-06-27T08:49:55-07:00
by Bonzo
Are you just looking at the thumbnail?

In Windows I get a black thumbnail but when open it is transparent.

Re: Create a transparent png file

Posted: 2014-06-27T09:06:14-07:00
by Florian26
Thanks to your answer :)

@glennrp : I have "ImageMagick-6.8.9-4-Q8-x64-dll.exe" (http://www.imagemagick.org/script/binar ... hp#windows) ... and a black image :/
My server will work with OS 64 bits so i prefer to use 64 bits ImageMagick

@bonzo : I have a black image, and when i open it with Photoshop, it's black image. When i open it with the IM's exe, it's transparent... How can i have a transparent image to all application ? And to see transparent in the web

Re: Create a transparent png file

Posted: 2014-06-27T09:54:19-07:00
by fmw42
This should fix it.

Code: Select all

exec('convert -size 100x100 xc:none PNG32:fond.png');
Your IM command produces only one color transparent black. The image is bilevel alpha and apparently PS sees it as binary only and ignores the alpha. Setting PNG32: will make it 32 bit color.

This works also by setting it to palette alpha 8bit color with transparency.

Code: Select all

exec('convert -size 100x100 xc:none PNG8:fond.png');

Re: Create a transparent png file

Posted: 2014-06-27T10:03:11-07:00
by Florian26
Black again in the windows explorer, but in photoshop, it's transparent !

Thanks a lot ! :)

Re: [resolved] Create a transparent png file

Posted: 2014-07-02T18:51:50-07:00
by anthony
How old is your windows explorer!

Old versions had major probelms with transparent PNG's but that should now be fixed. But then I am not a Windows user! ;-)
See this on the very TOP LEVEL of the IM Usgae web site
http://www.imagemagick.org/Usage/#PNG

Re: [resolved] Create a transparent png file

Posted: 2014-07-03T12:11:36-07:00
by Bonzo
Mine is Windows 7 and it shows a black thumbnail but when open it's OK

I was working with a server side image map and that has a problem in IE11 and Microsoft knew about the problem in IE9.

Re: [resolved] Create a transparent png file

Posted: 2014-07-03T12:55:56-07:00
by snibgo
Perhaps there is confusion on this thread between:

- Windows Explorer: a graphical interface to the file system;
- Windows Internet Explorer: a web browser.

In Windows 8.1, bang up-to-date, Windows Explorer shows a PNG or TIFF that is entirely transparent black (or transparent white or transparent pink etc) as black (or white or pink etc).