Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #370 // Image Inverter

Lua code - Image transformer

-- copy image and invert

w, h = img.width, img.height
pixels = {}
for y = 0, h-1 do
  for x = 0, w-1 do
    pixels[y*w+x+1] = 0xFFFFFF - img.getInt(x, y)
  end
end

test run  test run with input  download  show line numbers   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #370
Snippet name: Image Inverter
Eternal ID of this version: #370/1
Text MD5: ae38ee72926ba53e8bc93086af1143bb
Author: stefan
Category: image transformers
Type: Lua code - Image transformer
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-02-03 21:23:28
Source code size: 174 bytes / 9 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 769 / 823
Referenced in: #3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)