Search found 33 matches

by Peggy
2020-03-19T01:00:33-07:00
Forum: Users
Topic: Count amount of non-continuous blocks in an image
Replies: 60
Views: 11809

Re: Count amount of non-continuous blocks in an image

For the flower image, the input has transparent black pixels, with bands of transparent white at top and bottom. We can see these with: magick sixFlower.png -alpha off sixflower_na.png The result sixflower_na.png is: http://snibgo.com/imforums/sixflower_na.png The connected-component list correctly...
by Peggy
2020-03-18T23:19:12-07:00
Forum: Users
Topic: Count amount of non-continuous blocks in an image
Replies: 60
Views: 11809

Re: Count amount of non-continuous blocks in an image

@Peggy: Your results are very different from mine. Your images also look wrong, with horizontal bands. Please show the command you used, for example for the "six-flower" image. Perhaps the conversion to bash has introduced an error. @snibgo Could you please help me to see that why my flower image h...
by Peggy
2020-03-18T23:14:06-07:00
Forum: Users
Topic: Count amount of non-continuous blocks in an image
Replies: 60
Views: 11809

Re: Count amount of non-continuous blocks in an image

@Peggy: Your results are very different from mine. Your images also look wrong, with horizontal bands. Please show the command you used, for example for the "six-flower" image. Perhaps the conversion to bash has introduced an error. @snibgo Could you please help me to see that why my flower image h...
by Peggy
2020-03-17T01:07:44-07:00
Forum: Users
Topic: Count amount of non-continuous blocks in an image
Replies: 60
Views: 11809

Re: Count amount of non-continuous blocks in an image

@Peggy: Your results are very different from mine. Your images also look wrong, with horizontal bands. Please show the command you used, for example for the "six-flower" image. Perhaps the conversion to bash has introduced an error. After upgraded IM to IM7, the results look pretty good. version: V...
by Peggy
2020-03-15T22:50:34-07:00
Forum: Users
Topic: Count amount of non-continuous blocks in an image
Replies: 60
Views: 11809

Re: Count amount of non-continuous blocks in an image

@Peggy: Your results are very different from mine. Your images also look wrong, with horizontal bands. Please show the command you used, for example for the "six-flower" image. Perhaps the conversion to bash has introduced an error. Sorry for not getting back to you sooner. I'll re-install my IM to...
by Peggy
2020-03-13T03:15:57-07:00
Forum: Users
Topic: Count amount of non-continuous blocks in an image
Replies: 60
Views: 11809

Re: Count amount of non-continuous blocks in an image

Try this command: Thank you for the information. After I tested your command, some images couldn't get good result. such as: https://i.imgur.com/MbyTrUR.png Objects (id: bounding-box centroid area mean-color): 0: 512x512+0+0 248.2,258.7 208965 srgba(71,112,76,0) 7: 303x303+209+4 357.9,157.2 17253 s...
by Peggy
2020-03-13T01:28:57-07:00
Forum: Users
Topic: Count amount of non-continuous blocks in an image
Replies: 60
Views: 11809

Re: Count amount of non-continuous blocks in an image

The command I showed writes "Unique: N" where N is an integer. This is the number of unique colours found after de-anti-aliasing. That number is not important to you. Some infomation wasn't saved for my last reply, sorry about that. I did write connected-component result after unique number for eac...
by Peggy
2020-03-12T03:10:08-07:00
Forum: Users
Topic: Count amount of non-continuous blocks in an image
Replies: 60
Views: 11809

Re: Count amount of non-continuous blocks in an image

"+antialias" is a setting to prevent operations from anti-aliasing pixels. It does not remove anti-aliasing. I pointed you to a thread https://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=37649 where I show a command to remove anti-aliasing. For example (Windows BAT syntax): magick ^ pe...
by Peggy
2020-03-11T23:52:28-07:00
Forum: Users
Topic: Count amount of non-continuous blocks in an image
Replies: 60
Views: 11809

Re: Count amount of non-continuous blocks in an image

fmw42 wrote:
2020-03-11T23:04:12-07:00
For Imagemgick 6 on Unix-like systems, change ^ to \, change magick to convert, change %% to %, change CopyAlpha to CopyOpacity
change CopyAlpha to CopyOpacity <-- This one worked, thank you thank you!
by Peggy
2020-03-11T22:49:45-07:00
Forum: Users
Topic: Count amount of non-continuous blocks in an image
Replies: 60
Views: 11809

Re: Count amount of non-continuous blocks in an image

"+antialias" is a setting to prevent operations from anti-aliasing pixels. It does not remove anti-aliasing. I pointed you to a thread https://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=37649 where I show a command to remove anti-aliasing. For example (Windows BAT syntax): magick ^ pe...
by Peggy
2020-03-11T04:17:07-07:00
Forum: Users
Topic: Count amount of non-continuous blocks in an image
Replies: 60
Views: 11809

Re: Count amount of non-continuous blocks in an image

Your images have anti-aliasing between solid colours. I have already showed you a command to remove anti-aliasing. Do you mean this command? magick +antialias msvg:in.svg out.png The images I provided are png not svg, does it still work? I added +antialias to my command, the result is still incorre...
by Peggy
2020-03-11T03:18:15-07:00
Forum: Users
Topic: Count amount of non-continuous blocks in an image
Replies: 60
Views: 11809

Re: Count amount of non-continuous blocks in an image

I've done testing for some images, the results are shown as blow: Image 1: https://i.imgur.com/MbyTrUR.png https://i.imgur.com/vtO3TOU.png convert pen.png -background Black -layers Flatten -alpha off -define connected-components:verbose=true -define connected-components:area-threshold=100 -connected...
by Peggy
2020-03-11T02:45:25-07:00
Forum: Users
Topic: Count amount of non-continuous blocks in an image
Replies: 60
Views: 11809

Re: Count amount of non-continuous blocks in an image

Could I detect the image whether contains a specific color? Your "red-drop" image has 8 bits/channel/pixel. So the colour #000100000000 which is very nearly black is guaranteed not to be in your image. For this to work, your IM can't be Q8. It must be Q16 or larger. Alright, thanks for the informat...
by Peggy
2020-03-11T01:28:53-07:00
Forum: Users
Topic: Count amount of non-continuous blocks in an image
Replies: 60
Views: 11809

Re: Count amount of non-continuous blocks in an image

I suggest you flatten against a colour that isn't already used, eg black in this case. Then there is no alpha, and the problem is simpler. "Connected-components" then finds the four areas. magick f.png -background Black -layers Flatten -alpha off -define connected-components:verbose=true -define co...
by Peggy
2020-03-10T23:56:05-07:00
Forum: Users
Topic: Count amount of non-continuous blocks in an image
Replies: 60
Views: 11809

Re: Count amount of non-continuous blocks in an image

The technique works. It is your images that are not what you think they are in terms of number of colors. Yes, IM is amazing! I would never adoubt it. my question for now whould be: How to count non-continuous blocks from a compressed image with transparent background? A image might contains a lot ...