Pregunta

Esta es una imagen: Gradient1
Esta imagen es un simple gradiente de negro a transparente guardado en su totalidad RGBA PNG.

Aquí es la misma imagen, se convirtió al indexadas-alfa PNG por GIMP (Photoshop produce el mismo resultado)
Gradient2
Como se puede ver, el gradiente es ahora la mitad-opaco, semitransparente.

Esta es la misma imagen de nuevo, sólo que esta vez se convirtió en PNG-alfa indexado por un script PHP que escribió:
gradiente 3

Así que mi pregunta es: ¿Por qué son GIMP y Photoshop no puede apoyar la transparencia parcial en imágenes indexadas, cuando el script PHP muestra claramente que dicha imagen se puede crear sin problemas
¿Hay algo "malo" con una imagen cuya paleta de alfa contiene información?
Una programación relacionada con la pregunta más: ¿Esto transparencia en el último trabajo de imagen en Internet Explorer 6

?
¿Fue útil?

Solución 2

I've finally found the actual answer: There is a metadata entry that allows you to define the alpha value of each colour in the colour table. Most graphics programs don't make use of this, but it does exist and can be used, in particular by GD.

Otros consejos

For the record, PNG does not literally support indexed images with an alpha channel. What is really happening is that PNG allows you to add additional colors to the color table (i.e. index) with alpha values in those colors... not a complete alpha channel. FWIW...

Another option besides fireworks is pngquant, a command line application that will convert a rgba png into an indexed png with transparency.

I found this post which talks some more about how to use it.

IE6 and earlier in windows does not support variable transparency PNGs without annoying workarounds. An indexed PNG will only show the fully opaque parts which usually works pretty well. A drop shadow would disappear but the opaque parts of the logo or icon would continue to show.

This page has a better explanation and instructions with more png compression and quantization tools: http://calendar.perfplanet.com/2010/png-that-works/

Yeah I know what you mean. Fireworks is the only image editing program that I know of that can create and edit PNG8+Alpha without problems. I wish more paint programs would support this format cause Fireworks is expensive!

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top