Less outputs?

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
Hal300
Posts: 5
Joined: 2018-01-22T23:06:29-07:00
Authentication code: 1152

Less outputs?

Post by Hal300 »

I am trying to convert an image (black and white for now) into coordinates (x and y). I am using the command "convert image.png -threshold 50% txt:". Currently, whatever image I convert IM replies with around 640k sets of coordinates (800 in the x axis and 800 in the y axis). I need to send these coordinates to a stepper motor which is only able to make 200 steps. Is there a way of reducing the number of coordinates or at least minimising it? I need the image to be printed afterwards onto A3 sized paper for my project and so do not want to loose any resolution. Any help would be much appreciated.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Less outputs?

Post by snibgo »

Your question isn't clear to me.

If your stepper motor "is only able to make 200 steps" (in each direction?), then that's the resolution available. You "do not want to loose any resolution", but you don't have a choice?
snibgo's IM pages: im.snibgo.com
Hal300
Posts: 5
Joined: 2018-01-22T23:06:29-07:00
Authentication code: 1152

Re: Less outputs?

Post by Hal300 »

Sorry, I should of been more clear. I each direction my stepper motor is able to move 200 steps as it has a step angle of 1.8 degrees. I want to move the object left and right so the object can move 200 steps left and 200 steps back to the right. Same with it moving upwards and downwards. 200 steps upwards and 200 steps back down from the top. However, IM is giving me 800 coordinates in each direction. So it starts from (0,0) and goes all the way up to (800,800). Is there a way I can reduce the number of coordinates it gives me. To my understanding, it converts each pixel into a coordinate. Is it possible to group pixels so there are less sets of coordinates? I will try to add an image of my results to help illustrate my point.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Less outputs?

Post by Bonzo »

Resize the input image?
Hal300
Posts: 5
Joined: 2018-01-22T23:06:29-07:00
Authentication code: 1152

Re: Less outputs?

Post by Hal300 »

Thank you Bonzo. Completely forgot I could do that. Now it works perfectly.
Post Reply