Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I would like to do a custom monochrome conversion of any color image using a script. All colors except those in a narrow range are to be converted to white, and the colors within said narrow range are to be converted to black.
I've attached a sample picture to this post; the objective is to basically get a black dot in a white background (the black dot coming from the red dot).
Any advice on how to go about this?
Also, which is the best file format for quick image scanning/manipulations/conversions and maintenance of sharp edges? PNG?
For image manipulations you should use a format without compression, like BMP. Commandline tools for image editing and conversion are avilable, for example the ImageMagick tools, which should be available for amy distro. I am not experienced with those, but it should be possible to use them for your purpose.
I hope that helps a bit.
I'd like to know if there's something comprehensive too. I'm familiar with Photoshop and GIMP and both allow the bucket fill to "fill by color" however they both tend to find boundaries in shading, lines, or other things where the stop. Like I took a picture of Mt. Everest and tried to convert it using that technique and ... you'd be amazed how many shades of white ice/snow there are. Or they are interrupted by lines of some type. Hence you click and it fills some, but nowhere near enough.
Next, I am familiar with algorithms, unfortunately proprietary stuff where they scan line by line and filter, plus convert. So via a program, I'd follow those same procedures, which would be to load a line of pixels in an array, or rather load the whole picture if needed, then process the whole thing like a serial buffer, just [0][0] to [n][m] and convert based on a choice like > 50% = black, else = white.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.