Hi everyone. I'm new to imagemagick and so far so good... I'm playing around with what could be done by command line and I notice this:
Running the following command convert -flop image.jpg image.jpg , i.e, flopping an image to it self. This actions results in a loss of quality. The floped image starts to look a bit pixelized and stripes.
Is there anything I can do?
Thanks
convert -flop image.jpg image.jpg
Re: convert -flop image.jpg image.jpg
Are you running this command more than once? Keep in mind that JPEG is a lossy format. Each time you modify a JPEG image the image is re-compressed with a resulting loss of quality. After enough recompressions you end up with a bad-looking image. If you need to make several changes to a JPEG image, save the intermediate versions of the image in a non-lossy format such as ImageMagick's MIFF format.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert -flop image.jpg image.jpg
put the input image before the -flop and also regarding the loss, save the image in non-jpeg format such as png or use -quality 100
convert image.jpg -flop image1.png
or
convert image.jpg -flop -quality 100 image2.jpg
convert image.jpg -flop image1.png
or
convert image.jpg -flop -quality 100 image2.jpg
Re: convert -flop image.jpg image.jpg
That's because default quality is 80 or something like that.
Thanks a lot
Thanks a lot
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: convert -flop image.jpg image.jpg
Note that -quality 100 will only slow the loss in a normal JPEG image file format. It will only produce a lossless quality for JPEG2000 image file format.
However cmancre is right in that IM has no real way of determining the original quality (by default) of a input JPEG image. Though it does have a method of making a rough guess at the quality.
Best Ideal is to only use JPEG for the final display image, but keep images in some other loss-less format for later modifications. Better still always start from the source image rather than modify an already modified image.
See IM Examples, Common File Formats, JPEG for more info
However cmancre is right in that IM has no real way of determining the original quality (by default) of a input JPEG image. Though it does have a method of making a rough guess at the quality.
Best Ideal is to only use JPEG for the final display image, but keep images in some other loss-less format for later modifications. Better still always start from the source image rather than modify an already modified image.
See IM Examples, Common File Formats, JPEG for more info
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/