SGMLXML.net A place for SGML and XML application developers.

November 1, 2012

Portable Network Graphics (PNG)

Filed under: Linux,XML — cangione @ 11:31 pm

I like Portable Network Graphics for bitmap images. PNGs improve on the GIF format and are presentable in either PDF or web-based formats.

I was dealing with a client's data this week that included PNG graphics. The output quality was really poor but when I opened each graphic in a program like GIMP the image quality was fine. Turns out the source PNG files were corrupt. GIMP was fixing them before rendering them to the screen.

I found the corruption by using a Linux based command line utility called pngcheck.

20121102-004012.jpg

Once I discovered the problem, I used another command line utility called pngcrush with a shell script to loop through all the graphics and fix the errors.

20121102-003118.jpg

I love command lines!

C. Angione

Powered by WordPress