Post Reply 

generate a mask file for scientific image processing

Jul 23, 2013, 17:45
Post: #1
generate a mask file for scientific image processing
Hello all,

I opened a 1024x1024 image in GIMP, and manually broke it up into fully black and fully white sections. I'd like to output a file which is just a simple binary array of 8 bit numbers, such that every black pixel in the image has the value 0, and every white pixel has the value 1. This way, I can open it in my C program and then load the array into memory using the fread function.

I haven't been able to work out how to do this. I need to avoid using any files with metadata in them...And unfortunately, even the ppm format has a handful of characters at the beginning. Is there a way to do this?
Find all posts by this user
Quote this message in a reply
Jul 23, 2013, 19:50
Post: #2
RE: generate a mask file for scientific image processing
This might get you part of the way there

Put the image into indexed mode,

In the export dialog, the left hand side drop down menu, select raw

That gives you something like this.

[Image: FpHiZWD.jpg]

The other possibility is ImageJ
http://rsbweb.nih.gov/ij/features.html
where I can get that image into hex text, FF's and 00's but still needs some editing to remove tabs etc.

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How to centre an image inside a larger rectangle rossnroller 1 75 Jan 7, 2019 09:43
Last Post: paynekj
  Need Advise on tracing image Loriblackdog 1 151 Dec 10, 2018 17:18
Last Post: paynekj
  Make every image exact same size nibla 1 183 Dec 3, 2018 09:15
Last Post: paynekj
  some image have ( your name ) for editing but how commandera 2 206 Nov 1, 2018 18:55
Last Post: commandera
  Resizing an image down without losing quality AsdAsd 1 299 Oct 22, 2018 12:34
Last Post: paynekj

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS