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
  Image sizing Craig 1 44 Aug 15, 2018 12:14
Last Post: paynekj
  Tracing an Image GoddessKairos 1 199 Jun 12, 2018 21:42
Last Post: paynekj
  Resizing an image without pixelation? nopropsgames 2 228 Jun 9, 2018 22:39
Last Post: nopropsgames
  After floating a layer, how do you return the selection to the whole image? ithortureu 1 165 May 13, 2018 07:15
Last Post: paynekj
  Opening an image problem mes2370 1 211 May 11, 2018 15:20
Last Post: paynekj

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS