Controlling format of PNG export?

Ben Rubinstein benr_mc at cogapp.com
Tue Apr 29 21:35:00 EDT 2003


on 23/4/03 3:12 pm, Ben Rubinstein wrote

> Evidently, the MC engine, asked to export a PNG from a 32-bit + mask image,
> is cunningly inspecting it and deciding that there are no more than 256
> distinct colours, and therefore choosing to optimise the file.  I've no
> reason to think that these aren't perfectly valid PNG files (PhotoShop at
> least seems to see the transparency) - it's probably Director's error that
> it's ignoring the alpha channel if the basic image is not RGB.
> 
> I've frigged it for now by modifying the routine which does the sepia
> toning, introducing some random variations in the low-order bits of some
> pixels in the image, so that there are (invisibly to the human eye) more
> than 256 distinct colours in the image.  But this isn't 100% guaranteed to
> work for all source images.  Is there any way that I can force Rev/MC to
> output the PNG as RGB+alpha?

Scott,

Even if there is no way to control the behaviour, can you at least confirm
that the supposition in the first sentence above is correct?

I've been working on a stack which retrieves an image, does some processing
which both modifies the image and creates an alpha channel, and saves the
two as a PNG.  Having discovered the problem, I introduced a frig to attempt
to force RGB.  As noted above, this was never 100% guaranteed to work.
What's odd is that the people working at the installation site, where this
stack runs from a splash-screen standalone, were consistently getting
indexed+alpha.  Even when they sent me the source image, and running from
the splash-screen standalone, I've not been able to reproduce this - I'm
always getting RGB+alpha.  I can get index+alpha if I crop the image a lot -
this is reasonable given the above supposition, since if the image is small
enough, there just won't be 256 different colours in it.  But from their
source images, I'm not seeing it.  Maybe I was just unlucky (or I was lucky,
they were unlucky) with the 'random' perturbations of the pixels.  But it
does seem surprising.   Are there any other factors that might inform this
(I'm running on TiBook 9.2.2, they're on a very recent G4 running 9.2.2; we
both I believe have plenty of RAM, and they've not changed the memory
allocation of the standalone.  I'm not aware of any interesting differences
in the setup.

Any suggestions or info gratefully received.
 
  Ben Rubinstein               |  Email: benr_mc at cogapp.com
  Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600
  http://www.cogapp.com        |  Fax  : +44 (0)1273-728866




More information about the metacard mailing list