Page 1 of 1

Picture flipped(mirror image) after conversion to Color TIFF - 25035150

Posted: 2019-06-21T02:09:28-07:00
by Ganesh_B
  • Hi,
    Please check below columns to understand Image flip issue with attached specific file ‘IMG_0233.jpg’ after conversion to Color TIFF.
  • Subject ==> Picture flipped(mirror image) after conversion to Color TIFF - 25035150
  • Problem description ==> We have a Customer issue for a specific image ‘IMG_0233.jpg’ file where image is flipped after conversion to Color/Grayscale, 300 or 200 resolution TIFF file using class ‘class MagickPPExport Image’. TIFF file viewed in IrfanView viewer.
  • Replicate ==> We can see issue every time when we write code similar as in Code Snippet section below.
  • Code Snippets ==>
    Image img;
    img.read(“IMG_0233.jpg”);
    img->density(300x300);//illustrative
    img->quality(50);
    img->resolutionUnits(PixelsPerInchResolution);
    img.compressType(JPEG); //illustrative
    img.type(TrueColour); //illustrative
    img.depth(8);
    img.write(“Converted - 2019-06-21T115901.857.tiff”);
  • Component(s) ==> Image Magick Source build
  • Support request ==> Please find the root-cause for Image getting flipped or mirror image of original after conversion to Color TIFF file.
Regards
Ganesh.

Re: Picture flipped(mirror image) after conversion to Color TIFF - 25035150

Posted: 2019-06-21T02:11:28-07:00
by Ganesh_B
  • Version ==> ImageMagick 7.0.8-12
  • Support request ==> Please find the root-cause for Image getting flipped or mirror image of original after conversion to Color TIFF file.

Re: Picture flipped(mirror image) after conversion to Color TIFF - 25035150

Posted: 2019-06-21T04:55:36-07:00
by 246246
Both your input and output files has Orientation: RightTop (= 6) value.

Code: Select all

$ magick identify -verbose IMG_0233.jpg | grep -i orient
  Orientation: RightTop
    exif:Orientation: 6

$ magick identify -verbose 'Converted - 2019-06-21T115901.857.tiff' | grep -i orient
  Orientation: RightTop
Most viewer support orientation for JPEG but not for Tiff, that is the cause of the problem.
(If you see the files on Windows 7, both are rotated, because Windows 7 does not support orientation even for JPEG.)

So I suggest first rotate and/or flip the image to the stats of orientation = 1 (and set the orientation value to 1 or unset) somehow, then convert.
(From 6 to 1, rotate 90 degree clockwise. See https://magnushoff.com/jpeg-orientation.html for example.)

ImageMagick command line has -orient and -auto-orient option.

-auto-orient should do this work.

Re: Picture flipped(mirror image) after conversion to Color TIFF - 25035150

Posted: 2019-06-30T23:39:05-07:00
by Ganesh_B
Thanks a lot 246246, for detailed explanation and the info on blog post. It was much helpful.

Regards,
Ganesh.

Re: Picture flipped(mirror image) after conversion to Color TIFF - 25035150

Posted: 2019-07-04T03:13:35-07:00
by Ganesh_B
Thanks a lot 246246, for detailed explanation and the info on blog post. It was much helpful.

Regards,
Ganesh.