Hi,
I have a laser system that works with monochrome bitmaps only (0=laser OFF/ 1=laser ON).
Is it possible to convert a grayscale bitmap (eg. 8bit) in to a set of monochrome (255) bitmaps. This way I could do 255 passes with a different bitmap for each pass.
I want to slice a 8bit grayscale into 256 monochrome bitmaps (or the number of different values present in the greyscale bitmap)
An example:
If the value for a bit in the bitmap is 10, this would result in 10 bitmaps with the bit set to 1 and 245 bitmaps with the value set to 0
Does something like this exist? can you do this with imagemagick
slicing grayscale into multiple monochrome bitmaps
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: slicing grayscale into multiple monochrome bitmaps
I can see how to slice 8-bit values into 8 slices, but not into 256 slices.
How would you calculate what values to put in the 256 bitmaps? Suppose the input image had a value of 200. Would you put "1" in the first 200 bit maps, then "0" in the other 56?
How would you calculate what values to put in the 256 bitmaps? Suppose the input image had a value of 200. Would you put "1" in the first 200 bit maps, then "0" in the other 56?
snibgo's IM pages: im.snibgo.com
Re: slicing grayscale into multiple monochrome bitmaps
yes, exactly.
Think of it this way:
The value of a pixel in the bitmap is the number of times you shoot on a pixel with your laser.
Think of it this way:
The value of a pixel in the bitmap is the number of times you shoot on a pixel with your laser.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: slicing grayscale into multiple monochrome bitmaps
Windows CMD syntax, where in.png is a grayscale image:
This create outputs laser-000.png, laser-001.png, ... laser-255.png. They all contain pixels that are either black or white. The mean of all all the outputs laser-*.png reproduces in.png.
Depending on your laser device, it might be best if in.png was linear RGB (instead of sRGB), or some other transformation.
Code: Select all
magick in.png -duplicate 255 -threshold %[fx:t*QuantumRange/256] laser-%03d.png
Depending on your laser device, it might be best if in.png was linear RGB (instead of sRGB), or some other transformation.
snibgo's IM pages: im.snibgo.com