Check if pixel belongs to shape ?

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
ExpertNoob
Posts: 6
Joined: 2011-02-06T08:09:27-07:00
Authentication code: 8675308

Check if pixel belongs to shape ?

Post by ExpertNoob »

Does MagickCore have means of testing if a given pixel is in a given region of the image (circle, polygon, ..) ?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Check if pixel belongs to shape ?

Post by snibgo »

Draw the shape as white on a black background. Find the colour of the pixel. If it's white, it's inside the shape. Black means it's outside. Grey means it's on the edge.
snibgo's IM pages: im.snibgo.com
Post Reply