I am trying to convert white color backgrounded tif image type to transparent background png image type using below image magick command in alfresco 5.1.
magick convert source_file.tif -fuzz 20% -transparent white converted_file.png
But the above command is not working for all images. For many of images, the foreground color also changing to transparent partially .and for some images, the background is still showing white after conversion also.
please help me of finding a generic imagemagick command which will change only background color without disturbing the image colour .
Note: I tried with multiple fuzz values like 1% to 20% but not at all helping me.
Source image file is a layered image
Converting tif image white background to transparent png file format using image magick
-
- Posts: 2
- Joined: 2017-09-27T06:54:00-07:00
- Authentication code: 1151
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Converting tif image white background to transparent png file format using image magick
The command will be easy, once you define "background".venkat22 wrote:please help me of finding a generic imagemagick command which will change only background color without disturbing the image colour .
Cleary, "nearly white" isn't a good definition for you.
Some people find that "nearly white, and connected by other nearly-white pixels to the top-left corner" is a good definition, so they use a flood-fill.
snibgo's IM pages: im.snibgo.com
-
- Posts: 2
- Joined: 2017-09-27T06:54:00-07:00
- Authentication code: 1151
Re: Converting tif image white background to transparent png file format using image magick
Thankyou for your reply snibgo .
Can you provide command if the image background is full white for multi layered tif images ?
Can you provide command if the image background is full white for multi layered tif images ?