I'm trying trim and optimize this image this image http://www.revista.lamarea.com/wp-conte ... 7/03/h.jpg without resizing or changing his format but most of times I got a heavier image.
This is the image (I have renamed it as original.jpg):
Code: Select all
u@h ~/d $ wget http://www.revista.lamarea.com/wp-content/uploads/2017/03/h.jpg --quiet -O original.jpg
$ ls -lh original.jpg
-rw-rw-r-- 1 u u 2.2M Mar 27 22:41 original.jpg
u@h ~/d $ identify -verbose original.jpg
Image: original.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Mime type: image/jpeg
Class: DirectClass
Geometry: 4000x10500+0+0
Resolution: 100x100
Print size: 40x105
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: 42000000
Red:
min: 0 (0)
max: 255 (1)
mean: 243.25 (0.953921)
standard deviation: 37.0469 (0.145282)
kurtosis: 18.0869
skewness: -4.16267
Green:
min: 0 (0)
max: 255 (1)
mean: 242.074 (0.949308)
standard deviation: 40.0665 (0.157124)
kurtosis: 15.9259
skewness: -3.94768
Blue:
min: 0 (0)
max: 255 (1)
mean: 240.894 (0.94468)
standard deviation: 43.0608 (0.168866)
kurtosis: 13.7872
skewness: -3.73882
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 242.072 (0.949303)
standard deviation: 40.1332 (0.157385)
kurtosis: 15.8425
skewness: -3.94893
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: 4000x10500+0+0
Dispose: Undefined
Iterations: 0
Compression: JPEG
Quality: 69
Orientation: Undefined
Properties:
date:create: 2017-04-26T18:31:37+02:00
date:modify: 2017-03-27T22:41:34+02:00
jpeg:colorspace: 2
jpeg:sampling-factor: 2x2,1x1,1x1
signature: b778723dafd07abb245122ae3ecce35c6d512103ac916e82050da40c67ea01d9
Profiles:
Profile-app12: 15 bytes
Artifacts:
filename: original.jpg
verbose: true
Tainted: False
Filesize: 2.257MB
Number pixels: 42M
Pixels per second: 48.28MB
User time: 0.860u
Elapsed time: 0:01.870
Version: ImageMagick 6.8.9-9 Q16 x86_64 2017-03-14 http://www.imagemagick.org
Code: Select all
u@h ~/d $ convert original.jpg -strip +repage -trim -fuzz 600 01-TRIM.jpg
u@h ~/d $ convert original.jpg -strip +repage -trim -fuzz 600 -colors 32 02-TRIM-COLORS-32.jpg
u@h ~/d $ convert original.jpg -strip +repage -trim -fuzz 600 -colors 32 -quality 60 03-TRIM-COLORS-32-QUALITY-60.jpg
u@h ~/d $ ls -lh *.jpg
-rw-rw-r-- 1 u u 2.2M Apr 26 18:49 01-TRIM.jpg
-rw-rw-r-- 1 u u 2.5M Apr 26 18:51 02-TRIM-COLORS-32.jpg
-rw-rw-r-- 1 u u 2.2M Apr 26 18:54 03-TRIM-COLORS-32-QUALITY-60.jpg
-rw-rw-r-- 1 u u 2.2M Mar 27 22:41 original.jpg
u@h ~/d $ ls -l *.jpg
-rw-rw-r-- 1 u u 2298003 Apr 26 18:49 01-TRIM.jpg
-rw-rw-r-- 1 u u 2592610 Apr 26 18:51 02-TRIM-COLORS-32.jpg
-rw-rw-r-- 1 u u 2270907 Apr 26 18:54 03-TRIM-COLORS-32-QUALITY-60.jpg
-rw-rw-r-- 1 u u 2256783 Mar 27 22:41 original.jpg
u@h ~/d $ identify -format "%k colors in %f\n" *.jpg
204286 colors in 01-TRIM.jpg
186954 colors in 02-TRIM-COLORS-32.jpg
195756 colors in 03-TRIM-COLORS-32-QUALITY-60.jpg
199575 colors in original.jpg
u@h ~/d $ identify -format "%Q quality value in %f\n" *.jpg
69 quality value in 01-TRIM.jpg
69 quality value in 02-TRIM-COLORS-32.jpg
60 quality value in 03-TRIM-COLORS-32-QUALITY-60.jpg
69 quality value in original.jpg
- Why 01-TRIM.jpg have more colors than original.jpg?
- Why all "optimized" image have bigger file size than original.jpg?
- Why 02-TRIM-COLORS-32.jpg and 03-TRIM-COLORS-32-QUALITY-60.jpg don't have 32 colors?
- Why 03-TRIM-COLORS-32-QUALITY-60.jpg is bigger than 01-TRIM.jpg and 02-TRIM-COLORS-32.jpg?
- Why 03-TRIM-COLORS-32-QUALITY-60.jpg have more colors than 02-TRIM-COLORS-32.jpg?