Consider this tcl/tk code: it takes PPM-formated RGB data and saves it to a JPG file
image create photo tmpImg -data $Data -width $Width -height $Height -format ppm
tmpImg write $FName -format jpeg
image delete tmpImg
My question is: how can I set the quality of the resulting JPEG picture?
Is there a “-quality” option in Img::jpeg?
I could not find anything in the sparse documentation available….
Thanks a lot.
The documentation is rather sparse, but these options appear to be supported when reading and writing JPEG images:
-optimize,-progressive,-quality, and-smooth. The way you pass them when writing an image is more than a bit funky:Yes, they’re passed inside the
-formatoption. (Hey, I didn’t invent this bizarre hack!)