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
  delete image benhur 0 31 Yesterday 05:11
Last Post: benhur
  Change Print screen Image Settings dddemauro26 1 211 Sep 24, 2018 08:48
Last Post: paynekj
  best file type for resizing SNES graphics second.exodous 2 193 Sep 9, 2018 21:04
Last Post: second.exodous
  Error Message " gimp-image-set-resolution " quand 2 275 Sep 8, 2018 19:35
Last Post: quand
Exclamation URGENT! How do I restore layers or a previously saved version of a saved xcf image? Txsweetcheeks1981 3 4,379 Aug 24, 2018 14:15
Last Post: paynekj

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS