How should I select specific transparent pixels in tiff file?

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
nischaynamdev
Posts: 3
Joined: 2019-06-14T02:50:34-07:00
Authentication code: 1152

How should I select specific transparent pixels in tiff file?

Post by nischaynamdev » 2019-06-14T02:56:40-07:00

I wanted to select transparent pixels starting from coordinates:
x = 1 / y=1 / tolerance=0px

and then Stop selection where the edge of the image starts.

Transparent pixels ' within the image should not select, only the boundary/edges of the image should be selected. I tried different command but I'm unable to achieve this. can somebody help

snibgo
Posts: 11811
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How should I select specific transparent pixels in tiff file?

Post by snibgo » 2019-06-14T03:41:03-07:00

What version of IM, on what platform?

The top-left pixel is at (0,0), so (1,1) is in the next column and next row.

I don't understand what you want. IM doesn't really "select" pixels. Instead, we make a mask image where two colours represent selected or not selected. The mask can then be used to process just the "selected" pixels.

"-alpha extract" will make an image that is black where pixels were transparent. Then you could make all pixels except edge pixels white, with "-draw rectangle". Then you might flood-fill from top-left.

Perhaps you can supply a sample input, and say what the output should be.
snibgo's IM pages: im.snibgo.com

nischaynamdev
Posts: 3
Joined: 2019-06-14T02:50:34-07:00
Authentication code: 1152

Re: How should I select specific transparent pixels in tiff file?

Post by nischaynamdev » 2019-06-14T03:55:13-07:00

Hi, thanks for the reply.
I'm using the 7th version and would like to implement it on ubuntu server.

here what exactly I'm trying to do: < these are product images for e-commerce store>

- first Increase canvas size with 2 pixels horizontal and 2 pixels vertical (relative)
- Select all transparent pixels starting from coordinates x = 1 / y=1 / tolerance=opx. Stop selection where the edge of the product starts. Transparent pixels 'within the product are not selected, only the boundary/edges of the product.
- Invert selection
- Create a work path from selection
- Set name of clipping path to 'Path 1'
- Decrease canvas size with 2 pixels horizontal a 2 pixels vertical (relative)
- Save file

snibgo
Posts: 11811
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How should I select specific transparent pixels in tiff file?

Post by snibgo » 2019-06-14T04:15:27-07:00

IM cannot create clipping paths.
snibgo's IM pages: im.snibgo.com

nischaynamdev
Posts: 3
Joined: 2019-06-14T02:50:34-07:00
Authentication code: 1152

Re: How should I select specific transparent pixels in tiff file?

Post by nischaynamdev » 2019-06-14T05:02:02-07:00

isn't there any solution ?

snibgo
Posts: 11811
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How should I select specific transparent pixels in tiff file?

Post by snibgo » 2019-06-14T05:57:53-07:00

nischaynamdev wrote: - Create a work path from selection
- Set name of clipping path to 'Path 1'
This is vectorization, conversion of a raster image (pixels) into vectors. IM can't do that. Programs that can include:

Potrace
Autotrace
Inkscape
Gimp
traceContours (by me, unpublished)
snibgo's IM pages: im.snibgo.com

Post Reply