dengApro
dengApro

Reputation: 4008

imageMagick : replace image's color as tintColor

in iOS, there is a tintColor property in View. Then use it to replace image's color, rendering image as template.

like this

00

The color is perfect.

While I use imagemagick http://www.imagemagick.org/Usage/color_basics/#replace,

convert  -fuzz 40%     0.png -fill "#FE003E" -opaque "#3B7EF2"  1.png

333

There are some blue points.

Bigger of it:

666

Here is the raw image:

2222

How to do it more accurate with imagemagick?

Upvotes: 1

Views: 342

Answers (1)

fmw42
fmw42

Reputation: 53081

Here one simple way to do it in ImageMagick.

Your image has all the antialiasing in the alpha channel and the underlying image is mostly blue with some extraneous white outside the arrow and lines. So all we need to do is make the underlying image completely red without affecting the alpha channel.

Arrow Image:

enter image description here

convert arrow.png -fill red -colorize 100 result.png


enter image description here

Upvotes: 3

Related Questions