Lossless rotation of TIFF images.

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
SuNo
Posts: 3
Joined: 2019-02-06T07:50:45-07:00
Authentication code: 1152

Lossless rotation of TIFF images.

Post by SuNo » 2019-02-06T08:30:32-07:00

Dear readers,

I am not an advanced user of magick, neither know well the image processing domain.

I recently scanned a number (5000?) pictures from negative films, both color and BW, using an Epson V600 Perfection scanner, using the option to output images as TIFF (I wanted the less possible processing). The details given by the Epson software are:

Byte Order Windows
Color/Grayscale Compression: None [this is confirmed by the Windows file property]
B&W Compression: None
Embed ICC Profile ON

For the sake of completness, I chose 24-bit color @ 6400 dpi [143Mb files]

I realized at some point (call me stupid...) that I should have rotated at scanning time the portrait-format images, as a 90° rotation should be lossless (again at scan time).

Now, I want to use magick to lossless compress the portrait related files [easy to tag them, as I plan to do a QA pass on every picture]. However, I am not sure which magick's options will allow to:

1- lossless rotate in.tif to out.tif
2- ... while keeping the same format

I know this might sound a silly question, but I want to make sure I do not make mistakes

Thanks in advance,

SuNo
--
PS:
Version: ImageMagick 7.0.8-10 Q16 x64 2018-08-14 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype gslib heic jng jp2 jpeg lcms lqr lzma openexr pangocairo png ps raw rsvg tiff webp xml zlib

snibgo
Posts: 11448
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Lossless rotation of TIFF images.

Post by snibgo » 2019-02-06T08:35:46-07:00

First, check the compression. "magick -identify -verbose in.tiff" will have a line about compression. Check that this isn't JPEG.

Then you can simply rotate each image, eg:

Code: Select all

magick in.tiff -rotate 90 out.tiff
snibgo's IM pages: im.snibgo.com

SuNo
Posts: 3
Joined: 2019-02-06T07:50:45-07:00
Authentication code: 1152

Re: Lossless rotation of TIFF images.

Post by SuNo » 2019-02-06T10:42:10-07:00

Thanks - see result as a PS. No compression

So I guess, the default behaviour on magick rotate (and maybe other tools) is to keep parameters the same as the infile ?

SuNo


PS:
[gh]14% magick identify -verbose del.tiff
Image: del.tiff
Format: TIFF (Tagged Image File Format)
Mime type: image/tiff
Class: DirectClass
Geometry: 5546x8768+0+0
Resolution: 6400x6400
Print size: 0.866563x1.37
Units: PixelsPerInch
Colorspace: sRGB
Type: TrueColor
Endianess: LSB
Depth: 8-bit
Channel depth:
Red: 8-bit
Green: 8-bit
Blue: 8-bit
Channel statistics:
Pixels: 48627328
Red:
min: 2 (0.00784314)
max: 255 (1)
mean: 149.595 (0.586645)
standard deviation: 86.0149 (0.337314)
kurtosis: -1.74062
skewness: 0.309361
entropy: 0.651756
Green:
min: 0 (0)
max: 255 (1)
mean: 163.35 (0.640588)
standard deviation: 74.8859 (0.29367)
kurtosis: -1.54058
skewness: 0.104801
entropy: 0.724431
Blue:
min: 0 (0)
max: 255 (1)
mean: 169.912 (0.666322)
standard deviation: 68.6412 (0.269181)
kurtosis: -1.28492
skewness: -0.156048
entropy: 0.855083
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 160.952 (0.631185)
standard deviation: 76.514 (0.300055)
kurtosis: -1.59337
skewness: 0.0754264
entropy: 0.743757
Rendering intent: Perceptual
Gamma: 0.454545
Chromaticity:
red primary: (0.64,0.33)
green primary: (0.3,0.6)
blue primary: (0.15,0.06)
white point: (0.3127,0.329)
Matte color: grey74
Background color: white
Border color: srgb(223,223,223)
Transparent color: none
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 5546x8768+0+0
Dispose: Undefined
Iterations: 0
Compression: None
Orientation: TopLeft
Properties:
date:create: 2019-02-06T18:34:54+00:00
date:modify: 2019-02-06T18:34:54+00:00
icc:copyright: Copyright (c) SEIKO EPSON CORPORATION 2000 - 2006. All right
icc:description: EPSON sRGB
signature: ebbcac81207d9359ac238ed61c593cb8eea7a3cf32dcea3234d932a438dae2e4
tiff:alpha: unspecified
tiff:endian: lsb
tiff:photometric: RGB
tiff:rows-per-strip: 1
Profiles:
Profile-icc: 8708 bytes
Artifacts:
verbose: true
Tainted: False
Filesize: 139.199MiB
Number pixels: 48.6273M
Pixels per second: 226.173MB
User time: 0.219u
Elapsed time: 0:01.215
Version: ImageMagick 7.0.8-10 Q16 x64 2018-08-14 http://www.imagemagick.org

snibgo
Posts: 11448
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Lossless rotation of TIFF images.

Post by snibgo » 2019-02-06T10:53:38-07:00

SuNo wrote:So I guess, the default behaviour on magick rotate (and maybe other tools) is to keep parameters the same as the infile ?
Yes.

Your input has no compression, so the output will have no compression.

Some compression is lossless, eg Zip and LZW, so you could use those if you want.
snibgo's IM pages: im.snibgo.com

SuNo
Posts: 3
Joined: 2019-02-06T07:50:45-07:00
Authentication code: 1152

Re: Lossless rotation of TIFF images.

Post by SuNo » 2019-02-06T12:02:04-07:00

Thanks again.

Post Reply