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
  After floating a layer, how do you return the selection to the whole image? ithortureu 1 86 May 13, 2018 07:15
Last Post: paynekj
  Opening an image problem mes2370 1 120 May 11, 2018 15:20
Last Post: paynekj
Question How to automate "Autocrop Image"? javierdl 2 170 Mar 28, 2018 18:49
Last Post: javierdl
  Insert image on a screen under fingers AmandineViaud 1 140 Mar 28, 2018 06:03
Last Post: paynekj
  Is it possible to do embossing in a mask layer? Lilguystumpy 2 215 Mar 23, 2018 11:35
Last Post: Lilguystumpy

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS