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?".
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Contact:
Post
by snibgo » 2019-02-02T22:09:13-07:00
Resizing calculates each output pixel from a number of input pixels. Therefore it usually increases the number of unique colours:
Code: Select all
magick static_web_bg02_1.png -unique-colors info:
static_web_bg02_1.png PNG 231x1 231x1+0+0 8-bit sRGB 0.031u 0:00.031
magick static_web_bg02_1.png -resize 499x653 -unique-colors info:
static_web_bg02_1.png PNG 320713x1 320713x1+0+0 8-bit sRGB 0.219u 0:00.218
The number of colours has increased from 231 to 320713, so the image can no longer be stored as a palette type.
You can use "-sample" instead of "-resize", or use "-colors 255" after "-resize".
tczf1128
Posts: 28 Joined: 2018-12-04T22:47:49-07:00
Authentication code: 1152
Contact:
Post
by tczf1128 » 2019-02-02T22:50:07-07:00
what is the api in c about -colors options?
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Contact:
Post
by snibgo » 2019-02-02T23:00:59-07:00
I think it is QuantizeImage() in quantize.c.
Users browsing this forum: Ahrefs [Bot] , Amazon [Bot] , Bing [Bot] , Google [Bot] , Majestic-12 [Bot] , Semrush [Bot] and 29 guests