PNG size become bigger when after thumbnail the png
PNG size become bigger when after thumbnail the png
Hi:
Recently ,more and more png image size become bigger when after thumbnail.
Image:http://s3-us-west-2.amazonaws.com/qiniu-bs/bigger.png ( 720x300,57kb)
http://s3-us-west-2.amazonaws.com/qiniu-bs/bigger2.png (681x337,97.1kb)
Command:
convert bigger.png -thumbnail 600x +repage result.png
We find the result.png width and height both less than original, but the image's size both bigger than original.
Recently ,more and more png image size become bigger when after thumbnail.
Image:http://s3-us-west-2.amazonaws.com/qiniu-bs/bigger.png ( 720x300,57kb)
http://s3-us-west-2.amazonaws.com/qiniu-bs/bigger2.png (681x337,97.1kb)
Command:
convert bigger.png -thumbnail 600x +repage result.png
We find the result.png width and height both less than original, but the image's size both bigger than original.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: PNG size become bigger when after thumbnail the png
What version of IM are you using?
With v6.9.0-0 I get:
The width has shrunk to 600 pixels, as required. The size has more than doubled. We can see why: the "256c" label has gone. The input had only 256 colours, but interpolated resizing has increased the number of colours, so the output isn't palleted. I can cure this:
With v6.9.0-0 I get:
Code: Select all
f:\web\im>%IM%identify bigger.png
bigger.png PNG 720x300 720x300+0+0 8-bit sRGB 256c 56.5KB 0.000u 0:00.000
f:\web\im>%IM%convert bigger.png -thumbnail 600x b.png
f:\web\im>%IM%identify b.png
b.png PNG 600x250 600x250+0+0 8-bit sRGB 124KB 0.000u 0:00.000
Code: Select all
f:\web\im>%IM%convert bigger.png -thumbnail 600x -colors 255 -type Palette b.png
f:\web\im>%IM%identify b.png
b.png PNG 600x250 600x250+0+0 8-bit sRGB 253c 53.1KB 0.000u 0:00.000
snibgo's IM pages: im.snibgo.com
Re: PNG size become bigger when after thumbnail the png
snibgo wrote:What version of IM are you using?
With v6.9.0-0 I get:
The width has shrunk to 600 pixels, as required. The size has more than doubled. We can see why: the "256c" label has gone. The input had only 256 colours, but interpolated resizing has increased the number of colours, so the output isn't palleted. I can cure this:Code: Select all
f:\web\im>%IM%identify bigger.png bigger.png PNG 720x300 720x300+0+0 8-bit sRGB 256c 56.5KB 0.000u 0:00.000 f:\web\im>%IM%convert bigger.png -thumbnail 600x b.png f:\web\im>%IM%identify b.png b.png PNG 600x250 600x250+0+0 8-bit sRGB 124KB 0.000u 0:00.000
Code: Select all
f:\web\im>%IM%convert bigger.png -thumbnail 600x -colors 255 -type Palette b.png f:\web\im>%IM%identify b.png b.png PNG 600x250 600x250+0+0 8-bit sRGB 253c 53.1KB 0.000u 0:00.000
Thank you very much ,can you tell me how to optimise imagemagick to reduce computer memory consumption
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: PNG size become bigger when after thumbnail the png
snibgo's IM pages: im.snibgo.com
Re: PNG size become bigger when after thumbnail the png
Re: PNG size become bigger when after thumbnail the png
Sir,another quesstion :webp image become bigger too after thumbnail
Image:http://7te8ta.com1.z0.glb.clouddn.com/p ... pload.webp
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: PNG size become bigger when after thumbnail the png
You can use "-quality" with webp to trade-off quality against size. For example:
upload.webp is 5400 bytes. x.webp is 2034 bytes.
Code: Select all
f:\web\im>%IM%convert upload.webp -thumbnail 200x -quality 10 x.webp
snibgo's IM pages: im.snibgo.com
Re: PNG size become bigger when after thumbnail the png
snibgo wrote:You can use "-quality" with webp to trade-off quality against size. For example:upload.webp is 5400 bytes. x.webp is 2034 bytes.Code: Select all
f:\web\im>%IM%convert upload.webp -thumbnail 200x -quality 10 x.webp
Sir, the same question like bmp
Image:http://s3-us-west-2.amazonaws.com/qiniu-bs/bigger.png ( 720x300,57kb)
Command:
convert bigger.png -thumbnail 719x +repage result.png
We find the result.png width and height both less than original, but the image's size both bigger than original.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: PNG size become bigger when after thumbnail the png
Pngcrush may be useful.
snibgo's IM pages: im.snibgo.com
Re: PNG size become bigger when after thumbnail the png
Your means is imagemagick can't resolve?snibgo wrote:Pngcrush may be useful.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: PNG size become bigger when after thumbnail the png
As upthread: "The "256c" label has gone. The input had only 256 colours, but interpolated resizing has increased the number of colours, so the output isn't palleted." So use "-colors 255 -type Palette" again.
snibgo's IM pages: im.snibgo.com
Re: PNG size become bigger when after thumbnail the png
Pngcrush won't help much if there are more than 256 colors (including the background color) present.snibgo wrote:Pngcrush may be useful.
Re: PNG size become bigger when after thumbnail the png
pngquant is a good tool,but I want use imagemagickglennrp wrote:Pngcrush won't help much if there are more than 256 colors (including the background color) present.snibgo wrote:Pngcrush may be useful.
Re: PNG size become bigger when after thumbnail the png
Do you know the rulessnibgo wrote:As upthread: "The "256c" label has gone. The input had only 256 colours, but interpolated resizing has increased the number of colours, so the output isn't palleted." So use "-colors 255 -type Palette" again.
viewtopic.php?f=3&t=27130
Re: PNG size become bigger when after thumbnail the png
snibgo wrote:What version of IM are you using?
With v6.9.0-0 I get:
The width has shrunk to 600 pixels, as required. The size has more than doubled. We can see why: the "256c" label has gone. The input had only 256 colours, but interpolated resizing has increased the number of colours, so the output isn't palleted. I can cure this:Code: Select all
f:\web\im>%IM%identify bigger.png bigger.png PNG 720x300 720x300+0+0 8-bit sRGB 256c 56.5KB 0.000u 0:00.000 f:\web\im>%IM%convert bigger.png -thumbnail 600x b.png f:\web\im>%IM%identify b.png b.png PNG 600x250 600x250+0+0 8-bit sRGB 124KB 0.000u 0:00.000
Code: Select all
f:\web\im>%IM%convert bigger.png -thumbnail 600x -colors 255 -type Palette b.png f:\web\im>%IM%identify b.png b.png PNG 600x250 600x250+0+0 8-bit sRGB 253c 53.1KB 0.000u 0:00.000
Image :http://s3-us-west-2.amazonaws.com/qiniu-bs/2.png
Type :Palette2
If use command:
convert 2.png -thumbnail 400x b.png //size bigger than origin
But use command like you :
convert 2.png -thumbnail 400x -colors 2 -type Palette b.png
or
convert 2.png -thumbnail 400x -colors 1 -type Palette b.png
The result only one color and Opaque