以SQL的语法操作图片:pixQL

jopen 9年前

pixQL 实现了一个用SQL的语法来对图像进行操作的工具。

实例用法:

# turn all red pixels green  pixql -i in.bmp -o out.bmp -q "SELECT WHERE COLOR = #FF0000FF; OPERATE SET COLOR = #00FF00FF;"     # copy red channel into green channel  pixql -i in.bmp -o out.bmp -q "OPERATE SET G = R;"     # add white 1px 100x100 grid  pixql -i in.bmp -o out.bmp -q "SELECT WHERE ROW % 100 = 0 OR COL % 100 = 0; OPERATE SET COLOR = WHITE;"     # create 100x100 image with 10x10 checkerboard pattern  pixql -o out.bmp -q "BLACK(100,100); SELECT WHERE ROW % 20 < 10; OPERATE SET COLOR = WHITE; SELECT WHERE COL % 20 < 10; OPERATE SET R = 255-OUT.R; OPERATE SET G = 255-OUT.G; OPERATE SET B = 255-OUT.B;"

项目主页:http://www.open-open.com/lib/view/home/1435713851716