Log in

View Full Version : PNGs and ImageReader


AlanHK
16th January 2007, 03:12
I've been using the NoLogo filter on some files.

This uses a reference frame with the logo on a black background. To make that I did a screen capture in VDUBmod and saved it as a PNG. I like PNG because it's lossless and much smaller than an equivalent BMP (5k as opposed to 600k).
Then loaded it in an AVS as:

logo=ImageReader("logo414.png").ConverttoYUY2()
clip=AVISource("nt-414.avi",false).ConverttoYUY2()
NoLogoAuto(clip,logo,1)
etc...

This worked fine.

Then I thought I'd clean up the saved images a bit, fill the parts outside the logo area with pure black, I did this in Photoshop and saved the file as PNG again. Now the logo filter is ineffective. There are no errors, but it doesn't change the image.

Eventually I suspected something was wrong with the images.
I opened and just resaved them in Irfanview. These looked identical to the orignal, but were rather smaller in filesize; and now the logofilter worked again.

So I ran some scripts with just ImageReader("logo414.png") to just see the logo frames and found that in the Photoshop exported files the logos (light grey) were visible but much darker than the original or Irfanview versions, though in other image viewing apps they looked indistinguishable.

Anyway, I wonder if this is a known problem.
Are there preferred options when exporting PNG from Photoshop for this purpose?

Blue_MiSfit
16th January 2007, 04:02
Something to do with the colorspace conversion? That's about all I can think of. You might have to do it all in RGB32...

stickboy
16th January 2007, 05:39
Can you post an example of a PNG file that doesn't work and the corresponding version that does?

AlanHK
16th January 2007, 07:17
logo411-ok.png is the one that works as expected, logo411-PS.png is the Photoshop version that is much darker when displayed by ImageReader()

This script shows them together.

StackVertical(ImageReader("logo411-OK.png"),ImageReader("logo411-PS.png") )

I guess PNGs have some kind of palette and ImageReader doesn't parse it correctly (I doubt Photoshop is making an error).

-- PS. I just noticed the PS version also looks dark in my browser. Though in imaging apps they do look identical.

wonkey_monkey
16th January 2007, 10:19
Perhaps you saved the original 24 bit PNG as an 8 bit paletted PNG? That would be consistent with the smaller filesize, and if the image is quite simple (e.g. all in greyscale) there'd be little-to-no visual difference.

David

AlanHK
16th January 2007, 10:27
Perhaps you saved the original 24 bit PNG as an 8 bit paletted PNG? That would be consistent with the smaller filesize, and if the image is quite simple (e.g. all in greyscale) there'd be little-to-no visual difference.


I didn't choose any palette or bit depth options, so I don't know if that happened, and the smaller file, from Irfanview, is the one that works.