''' This file is part of pr0ntools Image utility class Copyright 2010 John McMaster <*****@*****.**> Licensed under the terms of the LGPL V3 or later, see COPYING for details ''' import Image import sys from temp_file import TempFile from temp_file import ManagedTempFile ''' images are indexed imageInstance[x][y] width = 5 x = ... 0 1 2 3 4 height = 4 y = 0 0 0 0 0 0 y = 1 1 1 1 1 1 y = 2 1 0 0 0 0 y = 3 1 0 0 0 0 Ex: imageInstance[3, 0] = 0 imageInstance[0, 2] = 1 Image.getdata() uses linear indexing: width / x