3 ms·
What if you dropped the whole `OPERATE SET x = y` syntax, and instead used traditional SELECT syntax, with column names as the attribute name to change. Editing
by infogulch 11y ago
What if you dropped the whole `OPERATE SET x = y` syntax, and instead used traditional SELECT syntax, with column names as the attribute name to change. Editing your simple examples:
# turn all red pixels green
# omitting column name assumes COLOR
pixql -i in.bmp -o out.bmp -q "SELECT #00FF00FF WHERE COLOR = #FF0000FF;"
# copy red channel into green channel
pixql -i in.bmp -o out.bmp -q "SELECT R AS G;"
# add white 1px 100x100 grid
pixql -i in.bmp -o out.bmp -q "SELECT WHITE AS COLOR WHERE ROW % 100 = 0 OR COL % 100 = 0;"
Edit: Combining this with a "FROM" syntax on your last example:
SELECT 255-R AS R, 255-G AS G, 255-B AS B
FROM (SELECT WHITE WHERE ROW % 20 < 10 FROM BLACK(100,100))
WHERE COL % 20 < 10;