Page 1 of 1

-mask {} -resize {} seems to have reduced quality?

Posted: 2019-05-11T04:48:24-07:00
by Seth
I'm currently working with an artist on a set of emotes at https://gitlab.com/Elypia/elypia-emotes
I was hoping he could make/export the 512px emotes, and then using ImageMagick I could automatically resize smaller versions of it for convenience and using the masks in the mask directory dictate when changing hue for additional color variations, what should change color.

The issue I've run into is images that do have a mask thus far, seem to suffer from degraded quality when resized?
A good example is "pandaAngry" which doesn't have a mask and "pandaAww" which does have a mask. (Feel free to ignore the rest.)

Image

I'm using ImageMagick 7.0.8.44-r0, this Dockerfile describes the setup in use:
https://gitlab.com/Elypia/elypia-emotes ... Dockerfile

This script contains the command(s) I'm performing:
https://gitlab.com/Elypia/elypia-emotes ... s/build.sh

Could anyone please advise me on how I could obtain a better result?

Edit:
Mask for pandaAww:
Image

Re: -mask {} -resize {} seems to have reduced quality?

Posted: 2019-05-11T04:59:58-07:00
by snibgo
For your v7, I suggest you use "magick", not "convert". And put the operations in their logical order: read the input, process the image, write the output.

What is your mask image? I suspect it is black and white only, so your "degraded quality" is the aliasing at edges. To get a better result, you need a better mask, ie with antialiasing.

Re: -mask {} -resize {} seems to have reduced quality?

Posted: 2019-05-11T06:47:54-07:00
by Seth
Thank you very much!
As you advised I used "magick" instead of "convert", and I reordered the arguments. I also used -clip-mask {} and then +clip-mask after applying the hue which is all the mask was for. (Not sure if this was possible with convert/-mask?)

The emotes are coming out exactly as expected now! ^-^