Page 1 of 1

One line — one color. 1bit RGB

Posted: 2018-04-05T02:43:25-07:00
by Appleist
Can Image Magick bulk-convert files from 256color (or more) to 3 color pure RGB + black, where every line has 1bit color. With 320x256 resolution.
1,4,7... lines has only red pixel
2,5,8... — ...blue
3,6,9... — ...green
....

For example:
original: Image converted: Image
some zoom: Image
other examples:
Image Image Image

Thank you!

Re: One line — one color. 1bit RGB

Posted: 2018-04-05T03:18:22-07:00
by snibgo
Windows BAT syntax:

Code: Select all

set SRC=1163342704.jpg

%IMG7%magick ^
  -size 1x1 ^
  xc:Red xc:Lime xc:Blue -append ^
  +write mpr:TILE +delete ^
  %SRC% ^
  ( +clone ^
    -tile mpr:TILE -draw "color 0,0 reset" ^
  ) ^
  -evaluate-sequence And ^
  +write 1163_1.jpg ^
  -channel RGB -threshold 25%% +channel ^
  1163_2.png
This keeps the levels in each channel:
Image

This sets the levels to 0 or 100%:
Image

You can set the threshold anywhere you like.