File: negative.py

package info (click to toggle)
lazpaint 7.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 56,000 kB
  • sloc: pascal: 277,538; python: 2,494; makefile: 233; sh: 221
file content (11 lines) | stat: -rw-r--r-- 313 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
# Negative
from lazpaint import image, layer, colors, dialog

width, height = image.get_size()
image = layer.get_image(0, 0, width, height)
for y in range(0, height):
  scanline = image[y]
  for x in range(0, width):    
    scanline[x] = scanline[x].linear_negative()
layer.put_image(0, 0, image, layer.DM_SET)