adapted module for custom image class
This commit is contained in:
@@ -27,9 +27,9 @@ class Inkyimage(inkycal_module):
|
||||
"Only PNG and JPG/JPEG images are used for the slideshow."
|
||||
},
|
||||
|
||||
"use_colour": {
|
||||
"label":"Does the display support colour?",
|
||||
"options": [True, False]
|
||||
"palette": {
|
||||
"label":"Which palette should be used for converting images?",
|
||||
"options": ["bw", "bwr", "bwy"]
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,7 +61,7 @@ class Inkyimage(inkycal_module):
|
||||
|
||||
# optional parameters
|
||||
self.path = config['path']
|
||||
self.use_colour = config['use_colour']
|
||||
self.palette = config['palette']
|
||||
self.autoflip = config['autoflip']
|
||||
self.orientation = config['orientation']
|
||||
|
||||
@@ -95,12 +95,8 @@ class Inkyimage(inkycal_module):
|
||||
# resize the image so it can fit on the epaper
|
||||
im.resize( width=im_width, height=im_height )
|
||||
|
||||
# convert images according to given settings
|
||||
if self.use_colour == False:
|
||||
im_black = im.to_mono()
|
||||
im_colour = Image.new('RGB', size = im_black.size, color = 'white')
|
||||
else:
|
||||
im_black, im_colour = im.to_colour()
|
||||
# convert images according to specified palette
|
||||
im_black, im_colour = im.to_palette(self.palette)
|
||||
|
||||
# with the images now send, clear the current image
|
||||
im.clear()
|
||||
|
Reference in New Issue
Block a user