One line — one color. 1bit RGB

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Appleist
Posts: 1
Joined: 2018-04-05T02:07:41-07:00
Authentication code: 1152

One line — one color. 1bit RGB

Post 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!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: One line — one color. 1bit RGB

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply