[Date Prev][Date Next] [Thread Prev][Thread Next]
[Date Index] [Thread Index] [New search]

PNGs and extra colors in FM (was RE: What image format to use)



Sharon Burton wrote:  

> I was referring to how you place the graphics in the source 
> files. I'm aware that PDFs are created by parsing Postscript.

My point is that neither the graphics file _format_ nor the _method_ of
placing graphics in the source file has *anything* to do with the PDF. 
 
> I'm trying to replicate the extra color definitions in Frame 
> with PNGs and can't do it. I opened a new Frame file and 
> imported 10 pngs and simply don't see the extra color defs...

I should have mentioned that I'm still using FM6 -- don't know if it
matters. In any case, thank you, Sharon! Your reply led me to do some
testing in order to confirm my recollections. At first, I became
confused -- some tests confirmed what I said, and some confirmed
Sharon's experience. 

If you don't care about the gory details, skip down to the bottom line.
But this is my story, and I'm sticking to it: <g>

I have an FS script that deletes a list of about 2300 "RGB..." colors. I
ran it on a couple of files containing about two dozen PNGs each, which
had several hundred of those colors in their color lists. After
round-tripping through MIF (you have to save the file as MIF to clear
the color list), they were free of the "RGB..." colors. 

But, at some point (save? reload graphics from disk?), those colors came
back. Aha, I thought smugly, Sharon's wrong and I'm right. 

But, to be thorough, I replicated her test, importing a couple of PNGs
into a "clean" doc and saving it. Hmm, no "RGB..." colors. Tried again
with another doc, copying the PNGs from a "dirty" doc. Still no new
colors -- just like Sharon said. 

So, I thought, the difference has to be in the PNGs. I started opening
the ones from a "dirty" doc in PaintShop Pro and looking at their
properties. The first several were 24-bit color (which I thought they
all were), but then I encountered one that was 8-bit. I imported it into
my "clean" test doc, saved, and -- bingo -- there were the "RGB..."
colors! Well, ten of them. 

Back to PSP and the Count Colors Used command -- yep, ten unique colors
in that PNG. 

So that's the explanation. An 8-bit PNG contains a palette of up to 256
named/defined colors. If you import it into FM, the color names in its
palette are added to FM's colors list. A 24-bit PNG doesn't contain a
palette of named colors (24 bits are enough to specify the RGB values
numerically), so no color names are added to the FM file. 

Converting my 10-color graphic from 8-bit to 24-bit increased its file
size from 2552 bytes to 3978. That's almost a 40% increase, but I can
live with it. 

Just out of curiosity, I saved the same graphic as an 8-bit BMP and
imported it into my FM test doc. The named colors did _not_ appear, so
it seems that FM doesn't have this problem with palettized BMPs. OTOH,
the file size went to 103,694! Yep, BMP still sucks. <g>   

Bottom line: Don't use palettized (8-bit, 256-color) PNGs. Use 24-bit
(16 million color) PNGs. 

Thanks again, Sharon!
 
Richard


------
Richard G. Combs
Senior Technical Writer
Voyant, a division of Polycom, Inc.
richardDOTcombs AT polycomDOTcom
richardDOTcombs AT voyanttechDOTcom
303-223-5111
------
rgcombs AT qwestDOTnet
303-777-0436
------







** To unsubscribe, send a message to majordomo@xxxxxxxxx **
** with "unsubscribe framers" (no quotes) in the body.   **