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

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?".
Post Reply
Seth
Posts: 14
Joined: 2019-05-11T04:32:10-07:00
Authentication code: 1152

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

Post 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
Last edited by Seth on 2019-05-11T06:52:47-07:00, edited 4 times in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
Seth
Posts: 14
Joined: 2019-05-11T04:32:10-07:00
Authentication code: 1152

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

Post 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! ^-^
Post Reply