Requirements on png files

81 views
Skip to first unread message

per.her...@divideon.com

unread,
Apr 18, 2018, 2:18:36 AM4/18/18
to Challenge on Learned Image Compression 2018
Hi,

In the new test set there are monochrome images which was not present in the validation set.
The library we used in our decoder to create png images automatically creates png images with gray scale color space for those types of images.
Although they are valid png images the python script that has been circulated on this list will not process them as they only have a single color channel instead of three RGB channels.

A simple modification to the python script is to change
image = np.asarray(Image.open(image_file), dtype=np.float32)

to
image = np.asarray(Image.open(image_file).convert('RGB'), dtype=np.float32)

Do you expect there to be any problems on your side to handle png images with grayscale pixel format?

Best Regards,
Per

ltheis

unread,
Apr 18, 2018, 5:27:09 AM4/18/18
to Challenge on Learned Image Compression 2018
Sorry about that. We tried to filter all grayscale images, but apparently missed some / something went wrong when compiling the test set.

I modified the server as suggested so that even when a decoder produces grayscale PNGs, the evaluation will work. Since there is a lot of activity on the server right now, I will try to restart it later. I will post here when that happened.

Thanks for catching this!

FYI, there are 8 grayscale images in the test set (out of 286 images):

alex-66.png

anders-jilden-239.png

florian-klauer-253.png

IMG_20170824_091006-EFFECTS.png

marco-sama-273.png

matthew-henry-16728.png

pavel-voinov-255.png

rula-sibai-64.png


These are not technically grayscale PNGs. If you read them into Python, you should get a full RGB image:


>>> Image.open('/Users/ltheis/Downloads/images_test/florian-klauer-253.png')

<PIL.PngImagePlugin.PngImageFile image mode=RGB size=2048x1344 at 0x7F46901E90B8>


>>> np.asarray(Image.open('/Users/ltheis/Downloads/images_test/florian-klauer-253.png')).shape

(1344, 2048, 3)

per.her...@divideon.com

unread,
Apr 18, 2018, 5:56:23 AM4/18/18
to Challenge on Learned Image Compression 2018
Great, thanks we will wait for restart before submitting.

And just to clarify to others, all the original images are in rgb even the grayscale ones.
The problem depends on what library you use to create png in your decoder.
If you use python PIL then this should not be an issue, it should always use RGB colors.
We were using lodePNG which would convert to grayscale to compress the png better (which doesn't matter in this use case).

ltheis

unread,
Apr 20, 2018, 6:06:30 AM4/20/18
to Challenge on Learned Image Compression 2018
I have restarted the server.
Reply all
Reply to author
Forward
0 new messages