2014-01-19 3 views
0

png를 png로 변환해야합니다.작은 크기로 크기를 조정할 때 Imagemagick 또는 GraphicsMagick이 내 PNG 이미지의 MB 크기를 늘리는 이유는 무엇입니까?

Mac OS X에서 ImageMagick 6.8.7-7을 사용하여 내 png 크기를 줄입니다. 여기

는 정확한 예입니다 start.png : 20866 × 8957 = 6.6 MB

start.png 상세한 평면도 단지 흑백

변환 start.png -resize 16384x7033 out.png

결과 16384 × 7033 out.png됩니다 = 36.9 MB

(심지어 변환 start.png -resize 16384x7033 out.jpg => 22.7MB out.jpg) 내가 out.png하는 "pngquant"을 적용하는 경우 15MB까지 줄일 수 있습니다

왜 이러한 증가가 발생합니까?

나는 out.png의 크기를 늘리지 않을 변환 옵션을 찾고 있습니까?


Image: start.png 
Format: PNG (Portable Network Graphics) 
Mime type: image/png 
Class: DirectClass 
Geometry: 20866x8957+0+0 
Resolution: 98.43x98.43 
Print size: 211.988x90.9987 
Units: PixelsPerCentimeter 
Type: Palette 
Endianess: Undefined 
Colorspace: sRGB 
Depth: 8-bit 
Channel depth: 
Compression: Zip 
Orientation: Undefined 
Properties: 
date:create: 2014-01-19T09:06:05+01:00 
date:modify: 2014-01-17T11:48:05+01:00 
png:iCCP: chunk was found 
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: 20866, 8957 
png:pHYs: x_res=9843, y_res=9843, units=1` 
Profiles: 
Profile-icc: 2576 bytes 
Artifacts: 
filename: start.png 
verbose: true 
Tainted: False 
Filesize: 6.603MB 
Number pixels: 186.9M 
Pixels per second: 41.63MB 
User time: 4.480u 
Elapsed time: 0:05.490 

** OUT.png

: 나는 더 많은 정보를 정기적으로 제공하는 경우

편집 은 아마 내가 실행 두 파일의 "-verbose 확인"을 다음과 같은 결과를 얻었다 하는 데 도움이 ...

Image: out.png 
Format: PNG (Portable Network Graphics) 
Mime type: image/png 
Class: DirectClass 
Geometry: 16384x7033+0+0 
Resolution: 98.43x98.43 
Print size: 166.453x71.4518 
Units: PixelsPerCentimeter 
Type: TrueColor 
Endianess: Undefined 
Colorspace: sRGB 
Depth: 8-bit 
Compression: Zip 
Orientation: Undefined 
Properties: 
date:create: 2014-01-19T09:55:41+01:00 
date:modify: 2014-01-19T09:55:41+01:00 
png:bKGD: chunk was found (see Background color, above) 
png:cHRM: chunk was found (see Chromaticity, above) 
png:iCCP: chunk was found 
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: 16384, 7033 
png:pHYs: x_res=9843, y_res=9843, units=1 
png:text: 3 tEXt/zTXt/iTXt chunks were found 
Profiles: 
Profile-icc: 2576 bytes 
Artifacts: 
filename: out.png 
verbose: true 
Tainted: False 
Filesize: 36.89MB 
Number pixels: 115.2M 
Pixels per second: 38.54MB 
User time: 2.980u 
Elapsed time: 0:03.990 
Version: ImageMagick 6.8.7-7 Q16 x86_6* 
+0

png는 zip과 같습니다. 원하는 압축 수준을 지정할 수 있습니다. 적은 압축 = 빠른 파일 생성하지만 일반적으로 더 높은 압축을 가진 파일보다 더 많은 공간이 필요합니다. 차례로 더 많은 CPU 시간이 필요하지만 더 작은 파일을 제공합니다. –

+0

실제로 05와 같은 변환시 일부 압축 옵션을 시도했습니다. 때때로 이것은 .png를 100MB로 늘릴 것입니다. 좋은 압축 값을 알고 있습니까? – jack

+2

"팔레트"에서 "TrueColor"로 변경됩니다 ... 그걸 뭔가 할 수 있습니까? –

답변

1

파일 크기가 커지는 이유는 크기 조정 작업으로 인해 색상 수가 증가하기 때문입니다. 기존의 (흑백) 색상 만 사용하려면 "크기 변경 WxH"를 "- 샘플 WxH"로 바꿀 수 있습니다.

ImageMagick을 사용하는 경우 "-define png : exclude-chunk = iCCP"와 함께 ICC 프로파일도 제거 할 수 있습니다. 흑백 이미지에서는 그다지 유용하지 않기 때문입니다. GraphicsMagick에서는이 옵션을 아직 사용할 수 없습니다.