Menu

PNG to JPEG

← TOC    ↑ Home    PNG PDF EPS JPEG

PNG to JPEG

This page shows how to convert a PNG image x.png into a JPEG image.

When creating JPEG files a quality parameter is required for the compromise between file size and image quality.
Typically the value is in the range 80...95.
Values below 25 and above 98 are not recommended.


Choice 1: Use gxhconvert

Procecure

gxhconvert -q=_quality_ -o=jpg x.png

See the [gxhconvert manual] for a full description of the gxhconvert script.

Options

Option Purpose
-q=... Qualitiy value.
--interlaced
--jpeg‑progressive
Create progressive JPEG. The start of the file (data stream) allows to render the image in low quality, details for better quality follow. This is the equivalent to an interlaced PNG file.
--optimized
--jpeg‑optimize
Optimize (decrease) file size. Computation takes a little longer and uses more memory.
--web Shortcut for --interlaced --optimized.

Choice 2: Manual conversion

pngtopam -mix x.png | pnmtojpeg -quality=_quality_ > x.jpg
← TOC    ↑ Home    PNG PDF EPS JPEG

Related

Wiki: gxhconvert manual