Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,19 @@
require('Image::Imlib2')
func tograyscale(img) {
var (width, height) = (img.width, img.height)
var gimg = %s'Image::Imlib2'.new(width, height)
for y,x in (^height ~X ^width) {
var (r, g, b) = img.query_pixel(x, y)
var gray = int(0.2126*r + 0.7152*g + 0.0722*b)
gimg.set_color(gray, gray, gray, 255)
gimg.draw_point(x, y)
}
return gimg
}
var (input='input.png', output='output.png') = ARGV...
var image = %s'Image::Imlib2'.load(input)
var gscale = tograyscale(image)
gscale.set_quality(80)
gscale.save(output)