Why are my JPEG files larger than expected? - image

gm convert +profile "*" -resize 800x800 -quality 90.0 -background white -flatten test.jpg test01.jpg
the test01.jpg file size is 140262, but the test.jpg file size is 114698, I think the test01.jpg file is less than test.jpg, why?
gm identify -verbose test.jpg command info:
Image: test.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Geometry: 960x1280
Class: DirectClass
Type: true color
Depth: 8 bits-per-pixel component
Channel Depths:
Red: 8 bits
Green: 8 bits
Blue: 8 bits
Channel Statistics:
Red:
Minimum: 0.00 (0.0000)
Maximum: 255.00 (1.0000)
Mean: 158.69 (0.6223)
Standard Deviation: 74.34 (0.2915)
Green:
Minimum: 0.00 (0.0000)
Maximum: 255.00 (1.0000)
Mean: 142.36 (0.5583)
Standard Deviation: 72.48 (0.2842)
Blue:
Minimum: 0.00 (0.0000)
Maximum: 255.00 (1.0000)
Mean: 105.80 (0.4149)
Standard Deviation: 73.05 (0.2865)
Resolution: 72x72 pixels
Filesize: 112.0Ki
Interlace: No
Orientation: TopLeft
Background Color: white
Border Color: #DFDFDF
Matte Color: #BDBDBD
Page geometry: 960x1280+0+0
Compose: Over
Dispose: Undefined
Iterations: 0
Compression: JPEG
JPEG-Quality: 64
JPEG-Colorspace: 2
JPEG-Colorspace-Name: RGB
JPEG-Sampling-factors: 2x2,1x1,1x1
Signature: ea09bde85095c8c8b2345e5301d581a8002490ecfefa63ae81c0cb14b8c2fbf8
Profile-iptc: 40 bytes
Profile-EXIF: 86 bytes
Orientation: 1
Exif Offset: 38
Color Space: 1
Exif Image Width: 960
Exif Image Length: 1280
Tainted: False
User Time: 0.020u
Elapsed Time: 0:01
Pixels Per Second: 39.1Mi

According to the "identify" output that you presented for the input image "test.jpg", the JPEG quality was estimated to be 64. You requested quality 90 for your output image.
Higher quality means bigger filesize. The increase in quality from 64 to 90 doesn't actually improve the visual quality of the image; it only forces the compressor to faithfully reproduce the compression artifacts in the input image.

Related

Converting a JPG to BMP with exact specs

I'm trying to alter the displayed boot splash of an AMLogic device (using this tool: https://github.com/steeve/aml-imgpack). I have a JPG which I convert to BMP, as the device needs (let's say https://unsplash.com/photos/SnXIF8_2oPw) but the colors are completely wrong, the image is broken in "lines" and some parts from left are to the right (a bit like repeating the image, but not completely).
The original image, have the following attributes:
$ magick identify -verbose ../original/bootup.bmp
Image:
Filename: ../original/bootup.bmp
Format: BMP (Microsoft Windows bitmap image)
Class: DirectClass
Geometry: 1920x1080+0+0
Resolution: 28.34x28.34
Print size: 67.7488x38.1087
Units: PixelsPerCentimeter
Colorspace: sRGB
Type: TrueColor
Base type: Undefined
Endianness: Undefined
Depth: 8-bit
Channel depth:
Red: 8-bit
Green: 8-bit
Blue: 8-bit
Channel statistics:
Pixels: 2073600
Red:
min: 0 (0)
max: 255 (1)
mean: 4.64305 (0.018208)
standard deviation: 31.5717 (0.12381)
kurtosis: 47.4739
skewness: 6.93758
entropy: 0.0513943
Green:
min: 0 (0)
max: 255 (1)
mean: 3.77976 (0.0148226)
standard deviation: 26.4192 (0.103605)
kurtosis: 55.8096
skewness: 7.40689
entropy: 0.0502694
Blue:
min: 0 (0)
max: 239 (0.937255)
mean: 1.81429 (0.00711485)
standard deviation: 13.2764 (0.0520643)
kurtosis: 84.5432
skewness: 8.63456
entropy: 0.0528362
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 3.41236 (0.0133818)
standard deviation: 23.7558 (0.0931598)
kurtosis: 67.5353
skewness: 8.07788
entropy: 0.0515
Rendering intent: Perceptual
Chromaticity:
red primary: (0,0)
green primary: (0,0)
blue primary: (0,0)
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: 1920x1080+0+0
Dispose: Undefined
Iterations: 0
Compression: Undefined
Orientation: Undefined
Convex hull: 931,391 932,391 1111,432 1223,484 1230,488 1247,544 1247,549 1244,551 1015,623 919,623 704,551 688,471 688,448 696,432 931,391
Minimum bounding box: 1247,391 1247,623 688,623 688,391
Properties:
date:create: 2020-10-31T22:40:38+00:00
date:modify: 2020-10-31T22:40:38+00:00
minimum-bounding-box:_p: 931,391
minimum-bounding-box:_q: 932,391
minimum-bounding-box:_v: 1015,623
minimum-bounding-box:angle: 0
minimum-bounding-box:area: 129688
minimum-bounding-box:height: 559
minimum-bounding-box:unrotate: -0
minimum-bounding-box:width: 232
signature: 31151e021e5d4cdde8d345165d8eb9cd6489f307272c8ca455d038002885d405
Artifacts:
verbose: true
Tainted: False
Filesize: 3.95515MiB
Number pixels: 2073600
Pixels per second: 79.4977MP
User time: 0.020u
Elapsed time: 0:01.026
Version: ImageMagick 7.0.10-30 Q16 x86_64 2020-09-20 https://imagemagick.org
I tried to convert using:
$ mogrify -format bmp ../new_bootup.jpg
$ mogrify -format bmp -type TrueColor ../new_bootup.jpg
$ mogrify -format bmp -define bmp:subtype=RGB565 ../new_bootup.jpg
but the image did not show correctly. The question is: which flags should I use (or which tool should I use) to achieve as close relpication of the original attributes as possible?

Images with the same resolution, same pixel quantity but one is 3X larger than the other

I'm processing two images from a HTML5 canvas, exporting it into a base64 using toDataUrl() and generating those images files, they have the same amount of pixels and same resolution, but one image file has 3x size than the other one.
Here is the Small sized image(1MB):
And here is the one with big size(3MB):
As you can see, the only difference is the black dots in the grid.
Here are the image magick's indentify verbose output.
To the non-dotted image:
Image: pontoSem.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Mime type: image/jpeg
Class: DirectClass
Geometry: 1805x1520+0+0
Resolution: 72x72
Units: PixelsPerInch
Type: TrueColor
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
Channel statistics:
Pixels: 2743600
Red:
min: 0 (0)
max: 255 (1)
mean: 239.227 (0.938144)
standard deviation: 50.1041 (0.196486)
kurtosis: 9.08055
skewness: -3.19968
Green:
min: 0 (0)
max: 255 (1)
mean: 241.654 (0.947662)
standard deviation: 44.0232 (0.17264)
kurtosis: 9.84544
skewness: -3.28708
Blue:
min: 0 (0)
max: 255 (1)
mean: 239.038 (0.937403)
standard deviation: 50.3878 (0.197599)
kurtosis: 8.93501
skewness: -3.18354
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 239.973 (0.94107)
standard deviation: 48.2611 (0.189259)
kurtosis: 9.42491
skewness: -3.24166
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)
Background color: white
Border color: srgb(223,223,223)
Matte color: grey74
Transparent color: black
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 1805x1520+0+0
Dispose: Undefined
Iterations: 0
Compression: JPEG
Quality: 100
Orientation: Undefined
Properties:
date:create: 2017-03-02T16:56:35-03:00
date:modify: 2017-03-02T16:52:35-03:00
jpeg:colorspace: 2
jpeg:sampling-factor: 2x2,1x1,1x1
signature: 23b092dd21773df0a63a3fffe8241f9916354e3d29638979d672e9cb91026c25
Artifacts:
filename: pontoSem.jpg
verbose: true
Tainted: False
Filesize: 1.063MB
Number pixels: 2.744M
Pixels per second: 45.73MB
User time: 0.040u
Elapsed time: 0:01.060
Version: ImageMagick 6.8.9-9 Q16 x86_64 2017-02-22
And here is the identify to the largest image (the dotted one)
Image: pontoCom.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Mime type: image/jpeg
Class: DirectClass
Geometry: 1805x1520+0+0
Resolution: 72x72
Print size: 25.0694x21.1111
Units: PixelsPerInch
Type: TrueColor
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
Channel statistics:
Pixels: 2743600
Red:
min: 0 (0)
max: 255 (1)
mean: 239.227 (0.938144)
standard deviation: 50.1041 (0.196486)
kurtosis: 9.08055
skewness: -3.19968
Green:
min: 0 (0)
max: 255 (1)
mean: 241.654 (0.947662)
standard deviation: 44.0232 (0.17264)
kurtosis: 9.84544
skewness: -3.28708
Blue:
min: 0 (0)
max: 255 (1)
mean: 239.038 (0.937403)
standard deviation: 50.3878 (0.197599)
kurtosis: 8.93501
skewness: -3.18354
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 239.973 (0.94107)
standard deviation: 48.2611 (0.189259)
kurtosis: 9.42491
skewness: -3.24166
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)
Background color: white
Border color: srgb(223,223,223)
Matte color: grey74
Transparent color: black
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 1805x1520+0+0
Dispose: Undefined
Iterations: 0
Compression: JPEG
Quality: 100
Orientation: Undefined
Properties:
date:create: 2017-03-02T16:56:35-03:00
date:modify: 2017-03-02T16:52:35-03:00
jpeg:colorspace: 2
jpeg:sampling-factor: 2x2,1x1,1x1
signature: 23b092dd21773df0a63a3fffe8241f9916354e3d29638979d672e9cb91026c25
Artifacts:
filename: pontoSem.jpg
verbose: true
Tainted: False
Filesize: 1.063MB
Number pixels: 2.744M
Pixels per second: 45.73MB
User time: 0.040u
Elapsed time: 0:01.060
Version: ImageMagick 6.8.9-9 Q16 x86_64 2017-02-22
I just would like to know why the add of some black dots triple the file size, because they have the same number of pixels, and the sape dpi resolution.
Thanks in advice :)
Jpeg format uses some clever tricks to reduce image size with respect to a raw bitmap image. Those techniques have different success depending on the particular image being represented and generally work better when there are no sharp differences between pixels that are close together. The black dots on white background are exactly the kind of thing that makes it difficult.
In the first image, lots of space can be described as "this area is all white" while the second one needs a much longer description mentioning the color of each pixel wherever those black pixels are near, which is almost everywhere
It's due to compression, the white squares on the first image is much more easily compressed than the second image with more randomness, as the image descriptor says it's using JPEG compression.
As most part of the surface area is using this background, it can easily impact in overall size as it compromises the compression algorithm efficiency.

How to determine if an image has a transparent pixel

I just found a piece of code that was used to determine if an image has transparent pixels:
my $alpha = $gd->transparent;
if ($alpha < 0) {
die("The image you uploaded has no transparent pixels. (alpha = $alpha)");
}
Obviously, this does not work. I tried it with the image user-desktop.png of the open icon library which has transparent pixels. The check returned -1.
I can only guess why this command was used. GD's manpage says:
If you call this method [transparent] without any parameters, it will return the current index of the transparent color, or -1 if none.
So, as a side question: the transparent pixels can have no color index at all - right?
Then I found the thread Perl GD check if pixel is transparent. But for this solution, I have to iterate over all pixels of an image (at least in the wort case, when the only transparent pixel would be the last one).
Isn't there an easy way of checking for this information? Maybe a method like $image_object->has_transparent_pixels ?
NB: I'm not bound to GD, so other Image modules might work as well (however, I'm on Windows - it should work there).
Updated Answer
As pointed out by #ikegami (thank you), GIFs have a designated transparent "colour" pixel in their palette rather than a alpha/transparency layer in which each pixel has its own transparency value, normally between 0-255.
I have generated a 2x2 pixel GIF with one transparent pixel, one red, one green and one blue - then ran ImageMagick's identify command against it and got the following. I have marked the transparent pixel parts with an arrow.
Image: a.gif
Format: GIF (CompuServe graphics interchange format)
Mime type: image/gif
Class: PseudoClass
Geometry: 4x4+0+0
Units: Undefined
Type: PaletteAlpha
Endianess: Undefined
Colorspace: sRGB
Depth: 8/1-bit
Channel depth:
red: 1-bit
green: 1-bit
blue: 1-bit
alpha: 1-bit
Channel statistics:
Pixels: 16
Red:
min: 0 (0)
max: 255 (1)
mean: 127.5 (0.5)
standard deviation: 127.5 (0.5)
kurtosis: -2
skewness: 0
Green:
min: 0 (0)
max: 255 (1)
mean: 127.5 (0.5)
standard deviation: 127.5 (0.5)
kurtosis: -2
skewness: 0
Blue:
min: 0 (0)
max: 255 (1)
mean: 127.5 (0.5)
standard deviation: 127.5 (0.5)
kurtosis: -2
skewness: 0
Alpha:
min: 0 (0)
max: 255 (1)
mean: 191.25 (0.75)
standard deviation: 110.418 (0.433013)
kurtosis: -0.666667
skewness: 1.1547
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 111.562 (0.4375)
standard deviation: 123.451 (0.484123)
kurtosis: -1.8275
skewness: 0.271109
Alpha: srgba(255,255,255,0) #FFFFFF00
Colors: 4
Histogram:
4: ( 0, 0,255,255) #0000FF blue
4: ( 0,255, 0,255) #00FF00 lime
4: (255, 0, 0,255) #FF0000 red
4: (255,255,255, 0) #FFFFFF00 srgba(255,255,255,0)
Colormap entries: 4
Colormap:
0: (255, 0, 0,255) #FF0000 red
1: ( 0,255, 0,255) #00FF00 lime
2: ( 0, 0,255,255) #0000FF blue
3: (255,255,255, 0) #FFFFFF00 srgba(255,255,255,0) <---------
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)
Background color: srgba(255,255,255,0)
Border color: srgba(223,223,223,1)
Matte color: grey74
Transparent color: srgba(255,255,255,0) <---------------
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 4x4+0+0
Dispose: Undefined
Compression: LZW
Orientation: Undefined
Properties:
date:create: 2014-10-11T10:40:09+01:00
date:modify: 2014-10-11T10:40:08+01:00
signature: 1c82b4c2e772fb075994516cc5661e9dec35b8142f89c651253d07fc3c4642bb
Profiles:
Profile-gif:xmp dataxmp: 1031 bytes
Artifacts:
filename: a.gif
verbose: true
Tainted: False
Filesize: 1.11KB
Number pixels: 16
Pixels per second: 16PB
User time: 0.000u
Elapsed time: 0:01.000
Version: ImageMagick 6.8.9-7 Q16 x86_64 2014-09-10 http://www.imagemagick.org
So, IM does know about the GIF transparent pixel - I will dig some more and see if it can be found sensibly in Perl - for now though, you could just run the following in Perl's backticks.
my $output = `identify -verbose a.gif | grep -i transparent`; # or maybe with FINDSTR on Windows
As an alternatvie, and less problematic across platforms, the %A escape tells you if an image has transparency enabled:
convert a.gif -print "%A" null:
True
convert a.jpg -print "%A" null:
False
Or, in a more Perl-y way:
#!/usr/bin/perl
use warnings;
use strict;
use Image::Magick;
my $image = Image::Magick->new();
$image->Read($ARGV[0]);
my $a = $image->Get('%A');
print $a;
perl ./script.pl a.gif
True
perl ./script.pl a.jpg
False
Original Answer
I think you may be a little confused about transparency. Images either have transparency, which is an entire layer, or they do not. In general, it is not a question of a single pixel being transparent or not. From the outset, JPEGs do not support transparency, GIF and PNG can support transparency but they are not necessarily always transparent.
So, assuming you have a PNG or a GIF, it could have a transparency layer. If it has, each pixel could either be totally transparent, totally opaque or somewhere in between. If you use ImageMagick, it is available at the command line or with PHP, Perl and other bindings.
From the command line, you can tell if an image has a transparency layer using this command:
convert InputImage.png -format "%[opaque]" info:
and it will either return true or false.
In Perl you can do this:
#!/usr/bin/perl
use warnings;
use strict;
use Image::Magick;
my $image = Image::Magick->new();
$image->Read($ARGV[0]);
my $a = $image->Get('%[opaque]');
print $a;
then run as:
perl ./script.pl ImageName.png

What does the "16" refer to in "16-bit Bilevel Gray" and "Depth: 16/1-bit"

ImageMagick's identify command line tool provides information on sampled images contained in image files. I'm trying to understand what the "16" means in the context of what it reports back.
I'm pretty sure this is a monochrome image with just one bit of content and one transparency bit per pixel, so I don't understand the role the "16" plays here. Is it that the 1 represents a grey level "value" of 65535 (i.e. all white, in this case)? Or does this have something to do with the 1-bit of content channel and 1-bit of alpha/transparency channel being packed into a 16-bit word?
In non-verbose mode, it reports:
20140123124823096.pdf PDF 1008x612 1008x612+0+0 **16-bit Bilevel Gray** 77.2KB 0.000u 0:00.000
In verbose mode, it reports the following:
Image: 20140123124823096.pdf
Format: PDF (Portable Document Format)
Mime type: application/pdf
Class: DirectClass
Geometry: 1008x612+0+0
Resolution: 72x72
Print size: 14x8.5
Units: Undefined
Type: Bilevel
Base type: Bilevel
Endianess: Undefined
Colorspace: Gray
Depth: 16/1-bit
Channel depth:
gray: 1-bit
alpha: 1-bit
Channel statistics:
Gray:
min: 0 (0)
max: 65535 (1)
mean: 60686.5 (0.926017)
standard deviation: 17153.4 (0.261744)
kurtosis: 8.59646
skewness: -3.25522
Alpha:
min: 65535 (1)
max: 65535 (1)
mean: 65535 (1)
standard deviation: 0 (0)
kurtosis: 0
skewness: 0
Colors: 2
Histogram:
45640: ( 0, 0, 0,65535) #000000000000 graya(0,1)
571256: (65535,65535,65535,65535) #FFFFFFFFFFFF graya(255,1)
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)
Background color: graya(255,1)
Border color: graya(223,1)
Matte color: graya(189,1)
Transparent color: graya(0,0)
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 1008x612+0+0
Dispose: Undefined
Iterations: 0
Compression: Undefined
Orientation: Undefined
Properties:
date:create: 2014-01-23T12:41:20-08:00
date:modify: 2014-01-23T12:41:20-08:00
pdf:HiResBoundingBox: 1008x612+0+0
pdf:Version: PDF-1.4
signature: 94e55396cd1b4dea139dcb39458ada0c904d80810722d7c03a62691d710755ab
Artifacts:
filename: 20140123124823096.pdf
verbose: true
Tainted: True
Filesize: 53.1KB
Number pixels: 617K
Pixels per second: 15.42MB
User time: 0.040u
Elapsed time: 0:01.039
Version: ImageMagick 6.8.7-3 2013-11-20 Q16 http://www.imagemagick.org
Update: It turns out that the information that ImageMagick's tool is reporting is not actually the information about the image in the PDF file, but apparently the information about the image after it's gone through some kind of internal transformation! I looked at the PDF file in a text editor and can see that it's unambiguously a 1-bit-per-pixel monochrome image at 200 dpi (legal size), rather than the 72 dpi image with an alpha channel that ImageMagick was reporting. All that said, I'm still curious as to what the 16 means even in ImageMagick's artificial world.
Here's a description of the image as it actually exists in the PDF:
<</Type/XObject
/Subtype/Image
/Width 2800
/Height 1700
/BitsPerComponent 1
/ColorSpace/DeviceGray
/Filter /CCITTFaxDecode
/DecodeParms <</Columns 2800 /Rows 1700>>
/Length 142719
>>

Can a PNG be encrypted without losing the exif data?

I've been working on this Reddit puzzle:
http://www.reddit.com/r/playitforward/comments/1v6jfh/contest_first_one_to_solve_this_riddle_gets_my/
and most of users in the thread are stumped. Full disclosure, I'd love to win the prize, but by bringing attention to it and asking for assistance, I understand that I lessen my chances, but at this point I want to know what the image says more than anything.
We narrowed down the cyphers to a URL to a text file with PNG exif data, but when opened as a PNG, it turns out corrupted. Could this PNG be encrypted or purposely corrupted in a way to preserve the exif data and what would be the best way to unravel it? Note that the string of numbers and "AK" were explicitly linked to this clue, so I can only assume there is maybe an Asynchronous Key involved or some standard pioneered by Arjen Kampf Lenstra or some Angry Kid behind it all.
Sure, using ImageMagick like this:
# Look at rose image before we start, and its header
identify -verbose rose.jpg
Image: rose.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Mime type: image/jpeg
Class: DirectClass
Geometry: 70x46+0+0
Units: Undefined
Type: TrueColor
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
Channel statistics:
Pixels: 3220
Red:
min: 31 (0.121569)
max: 255 (1)
mean: 145.56 (0.570825)
standard deviation: 69.1755 (0.271277)
kurtosis: -1.38839
skewness: 0.139004
entropy: 0.97057
Green:
min: 27 (0.105882)
max: 255 (1)
mean: 89.2475 (0.34999)
standard deviation: 52.4516 (0.205693)
kurtosis: 2.60505
skewness: 1.80798
entropy: 0.869705
Blue:
min: 21 (0.0823529)
max: 255 (1)
mean: 80.4214 (0.315378)
standard deviation: 54.9267 (0.215399)
kurtosis: 2.93861
skewness: 1.9566
entropy: 0.85334
Image statistics:
Overall:
min: 21 (0.0823529)
max: 255 (1)
mean: 105.076 (0.412064)
standard deviation: 59.3109 (0.232592)
kurtosis: 1.24657
skewness: 1.44732
entropy: 0.897872
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)
Background color: white
Border color: srgb(223,223,223)
Matte color: grey74
Transparent color: black
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 70x46+0+0
Dispose: Undefined
Iterations: 0
Compression: JPEG
Quality: 92
Orientation: Undefined
Properties:
date:create: 2015-10-04T18:46:03+01:00
date:modify: 2015-10-04T18:46:03+01:00
jpeg:colorspace: 2
jpeg:sampling-factor: 1x1,1x1,1x1
signature: 38a8912b601557d5a377bff360f03804c383c3298b48d9917504b488e8f4152b
Artifacts:
filename: rose.jpg
verbose: true
Tainted: False
Filesize: 2.65KB
Number pixels: 3.22K
Pixels per second: 3.22EB
User time: 0.000u
Elapsed time: 0:01.000
Version: ImageMagick 6.9.1-10 Q32 x86_64 2015-10-02 http://www.imagemagick.org
Now add a comment into the image and encrypt it as encrypted.png:
convert -comment "Freddy frog" rose.jpg -encipher passphrase.txt encrypted.png
Check the header of encrypted image to see if EXIF data and comment and other data are visible within it - yes, they are:
identify -verbose encrypted.png
Image: encrypted.png
Format: PNG (Portable Network Graphics)
Mime type: image/png
Class: DirectClass
Geometry: 70x46+0+0
Units: Undefined
Type: TrueColor
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
Channel statistics:
Pixels: 3220
Red:
min: 0 (0)
max: 255 (1)
mean: 126.755 (0.497077)
standard deviation: 73.7824 (0.289343)
kurtosis: -1.18047
skewness: 0.0142557
entropy: 0.99254
Green:
min: 0 (0)
max: 255 (1)
mean: 127.937 (0.501712)
standard deviation: 75.0501 (0.294314)
kurtosis: -1.23185
skewness: -0.0233363
entropy: 0.992485
Blue:
min: 0 (0)
max: 255 (1)
mean: 127.594 (0.500368)
standard deviation: 74.64 (0.292706)
kurtosis: -1.22352
skewness: -0.0177342
entropy: 0.992544
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 127.428 (0.499719)
standard deviation: 74.4927 (0.292128)
kurtosis: -1.21239
skewness: -0.00900116
entropy: 0.992523
Rendering intent: Perceptual
Gamma: 0.45455
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)
Background color: white
Border color: srgb(223,223,223)
Matte color: grey74
Transparent color: black
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 70x46+0+0
Dispose: Undefined
Iterations: 0
Compression: Zip
Orientation: Undefined
Properties:
cipher:mode: CTR
cipher:nonce: d3d57ca43eacb27a9d72b65ef976923e5b761c7aaaee1d1914d1769ca4834488
cipher:type: AES
comment: Freddy frog <--- comment is visible
date:create: 2015-10-04T18:48:43+01:00
date:modify: 2015-10-04T18:48:43+01:00
png:bKGD: chunk was found (see Background color, above)
png:cHRM: chunk was found (see Chromaticity, above)
png:gAMA: gamma=0.45454544 (See Gamma, above)
png:IHDR.bit-depth-orig: 8
png:IHDR.bit_depth: 8
png:IHDR.color-type-orig: 2
png:IHDR.color_type: 2 (Truecolor)
png:IHDR.interlace_method: 0 (Not interlaced)
png:IHDR.width,height: 70, 46
png:sRGB: intent=0 (Perceptual Intent)
png:text: 6 tEXt/zTXt/iTXt chunks were found
signature: 273e3934027f6ffbcf00b3eca7eb0c576d8fd180e87133112ecacd59225986ee
Artifacts:
filename: encrypted.png
verbose: true
Tainted: False
Filesize: 10.1KB
Number pixels: 3.22K
Pixels per second: 3.22EB
User time: 0.000u
Elapsed time: 0:01.000
Version: ImageMagick 6.9.1-10 Q32 x86_64 2015-10-02 http://www.imagemagick.org
Now look at the encrypted image - junk
Decrypt image as decrypted.jpg - looks like a rose to me :-)
convert encrypted.png -decipher passphrase.txt decrypted.jpg

Resources