<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">inkycal.main.</span></span><spanclass="sig-name descname"><spanclass="pre">Inkycal</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">settings_path</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">render</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">True</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.main.Inkycal"title="Permalink to this definition"></a></dt>
<dd><p>Inkycal main class</p>
<p>Main class of Inkycal, test and run the main Inkycal program.</p>
<dlclass="simple">
<dt>Args:</dt><dd><ulclass="simple">
<li><p>settings_path = str -> the full path to your settings.json file
if no path is given, tries looking for settings file in /boot folder.</p></li>
<li><p>render = bool (True/False) -> show the image on the epaper display?</p></li>
</ul>
</dd>
<dt>Attributes:</dt><dd><ulclass="simple">
<li><p>optimize = True/False. Reduce number of colours on the generated image
to improve rendering on E-Papers. Set this to False for 9.7” E-Paper.</p></li>
<emclass="property"><spanclass="pre">classmethod</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">add_module</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">filepath</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.main.Inkycal.add_module"title="Permalink to this definition"></a></dt>
<dd><p>registers a third party module for inkycal.</p>
<p>Uses the full filepath of the third party module to check if it is inside
the correct folder, then checks if it’s an inkycal module. Lastly, the
init files in /inkycal and /inkycal/modules are updated to allow using
the new module.</p>
<dl>
<dt>Args:</dt><dd><ulclass="simple">
<li><p>filepath: The full filepath of the third party module. Modules should be
in Inkycal/inkycal/modules.</p></li>
</ul>
</dd>
<dt>Usage:</dt><dd><ul>
<li><p>download a third-party module. The exact link is provided by the
<spanclass="sig-name descname"><spanclass="pre">calibrate</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.main.Inkycal.calibrate"title="Permalink to this definition"></a></dt>
<dd><p>Calibrate the E-Paper display</p>
<p>Uses the Display class to calibrate the display with the default of 3
cycles. After a refresh cycle, a new image is generated and shown.</p>
<spanclass="sig-name descname"><spanclass="pre">countdown</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">interval_mins</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.main.Inkycal.countdown"title="Permalink to this definition"></a></dt>
<dd><p>Returns the remaining time in seconds until next display update</p>
<emclass="property"><spanclass="pre">classmethod</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">remove_module</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">filename</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">remove_file</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">True</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.main.Inkycal.remove_module"title="Permalink to this definition"></a></dt>
<dd><p>unregisters an inkycal module.</p>
<p>Looks for given filename.py in /modules folder, removes entries of that
module in init files inside /inkycal and /inkycal/modules</p>
<dl>
<dt>Args:</dt><dd><ulclass="simple">
<li><p>filename: The filename (with .py ending) of the module which should be
unregistered. e.g. <cite>‘mymodule.py’</cite></p></li>
<li><p>remove_file: ->bool (True/False). If set to True, the module is deleted
after unregistering it, else it remains in the /modules folder</p></li>
</ul>
</dd>
<dt>Usage:</dt><dd><ul>
<li><p>Look for the module in Inkycal/inkycal/modules which should be removed.
Only the filename (with .py) is required, not the full path.</p>
<p>Use this function to unregister the module from inkycal:</p>
<spanclass="sig-name descname"><spanclass="pre">run</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.main.Inkycal.run"title="Permalink to this definition"></a></dt>
<dd><p>Runs main program in nonstop mode.</p>
<p>Uses an infinity loop to run Inkycal nonstop. Inkycal generates the image
from all modules, assembles them in one image, refreshed the E-Paper and
<spanclass="sig-name descname"><spanclass="pre">test</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.main.Inkycal.test"title="Permalink to this definition"></a></dt>
<dd><p>Tests if Inkycal can run without issues.</p>
<p>Attempts to import module names from settings file. Loads the config
for each module and initializes the module. Tries to run the module and
checks if the images could be generated correctly.</p>
<p>Generated images can be found in the /images folder of Inkycal.</p>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">inkycal.display.display.</span></span><spanclass="sig-name descname"><spanclass="pre">Display</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">epaper_model</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.display.display.Display"title="Permalink to this definition"></a></dt>
<dd><p>Display class for inkycal</p>
<p>Creates an instance of the driver for the selected E-Paper model and allows
rendering images and calibrating the E-Paper display</p>
<dlclass="simple">
<dt>Args:</dt><dd><ulclass="simple">
<li><p>epaper_model: The name of your E-Paper model.</p></li>
<spanclass="sig-name descname"><spanclass="pre">calibrate</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">cycles</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">3</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.display.display.Display.calibrate"title="Permalink to this definition"></a></dt>
<dd><p>Calibrates the display to retain crisp colours</p>
<p>Flushes the selected display several times with it’s supported colours,
removing any previous effects of ghosting.</p>
<dlclass="simple">
<dt>Args:</dt><dd><ulclass="simple">
<li><p>cycles: -> int. The number of times to flush the display with it’s
supported colours.</p></li>
</ul>
</dd>
</dl>
<p>It’s recommended to calibrate the display after every 6 display updates
for best results. For black-white only displays, calibration is less
critical, but not calibrating regularly results in grey-ish text.</p>
<p>Please note that calibration takes a while to complete. 3 cycles may
take 10 minutes on black-white E-Papers while it takes 20 minutes on coloured
<emclass="property"><spanclass="pre">classmethod</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">get_display_names</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">list</span></span></span><aclass="headerlink"href="#inkycal.display.display.Display.get_display_names"title="Permalink to this definition"></a></dt>
<dd><p>Prints all supported E-Paper models.</p>
<p>Fetches all filenames in driver folder and prints them on the console.</p>
<dlclass="simple">
<dt>Returns:</dt><dd><p>Printed version of all supported Displays.</p>
</dd>
</dl>
<p>Use one of the models to intilialize the Display class in order to gain
access to the E-Paper.</p>
<p>You can use this function directly without creating the Display class:</p>
<spanclass="sig-name descname"><spanclass="pre">get_display_size</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">tuple</span></span></span><aclass="headerlink"href="#inkycal.display.display.Display.get_display_size"title="Permalink to this definition"></a></dt>
<dd><p>Returns the size of the display as a tuple -> (width, height)</p>
<dlclass="simple">
<dt>Args:</dt><dd><ulclass="simple">
<li><p>model_name: str -> The name of the E-Paper display to get it’s size.</p></li>
</ul>
</dd>
<dt>Returns:</dt><dd><p>(width, height) ->tuple, showing the size of the display</p>
</dd>
</dl>
<p>You can use this function directly without creating the Display class:</p>
<emclass="property"><spanclass="pre">async</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">render</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">im_black:</span><spanclass="pre">~PIL.Image.Image</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">im_colour=<class</span><spanclass="pre">'PIL.Image.Image'></span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="headerlink"href="#inkycal.display.display.Display.render"title="Permalink to this definition"></a></dt>
<dd><p>Renders an image on the selected E-Paper display.</p>
<p>Initlializes the E-Paper display, sends image data and executes command
to update the display.</p>
<dlclass="simple">
<dt>Args:</dt><dd><ulclass="simple">
<li><p>im_black: The image for the black-pixels. Anything in this image that is
black is rendered as black on the display. This is required and ideally
should be a black-white image.</p></li>
<li><p>im_colour: For E-Paper displays supporting colour, a separate image,
ideally black-white is required for the coloured pixels. Anything that is
black in this image will show up as either red/yellow.</p></li>
</ul>
</dd>
</dl>
<p>Rendering an image for black-white E-Paper displays:</p>
<p>Rendering coloured image where 2 images are available:</p>
<divclass="doctest highlight-default notranslate"><divclass="highlight"><pre><span></span><spanclass="gp">>>></span><spanclass="n">black_image</span><spanclass="o">=</span><spanclass="n">Image</span><spanclass="o">.</span><spanclass="n">open</span><spanclass="p">(</span><spanclass="s1">'path/to/file.png'</span><spanclass="p">)</span><spanclass="c1"># black pixels</span>
<spanid="custom-functions"></span><h1>Custom functions<aclass="headerlink"href="#module-inkycal.custom.functions"title="Permalink to this heading"></a></h1>
<spanclass="sig-prename descclassname"><spanclass="pre">inkycal.custom.functions.</span></span><spanclass="sig-name descname"><spanclass="pre">auto_fontsize</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">font</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">max_height</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.custom.functions.auto_fontsize"title="Permalink to this definition"></a></dt>
<dd><p>Scales a given font to 80% of max_height.</p>
<p>Gets the height of a font and scales it until 80% of the max_height
is filled.</p>
<dlclass="simple">
<dt>Args:</dt><dd><ulclass="simple">
<li><p>font: A PIL Font object.</p></li>
<li><p>max_height: An integer representing the height to adjust the font to
which the given font should be scaled to.</p></li>
</ul>
</dd>
<dt>Returns:</dt><dd><p>A PIL font object with modified height.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">inkycal.custom.functions.</span></span><spanclass="sig-name descname"><spanclass="pre">get_fonts</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.custom.functions.get_fonts"title="Permalink to this definition"></a></dt>
<dd><p>Print all available fonts by name.</p>
<p>Searches the /font folder in Inkycal and displays all fonts found in
there.</p>
<dl>
<dt>Returns:</dt><dd><p>printed output of all available fonts. To access a fontfile, use the
<spanclass="sig-prename descclassname"><spanclass="pre">inkycal.custom.functions.</span></span><spanclass="sig-name descname"><spanclass="pre">get_system_tz</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.custom.functions.get_system_tz"title="Permalink to this definition"></a></dt>
<dd><p>Gets the system-timezone</p>
<p>Gets the timezone set by the system.</p>
<dlclass="simple">
<dt>Returns:</dt><dd><ulclass="simple">
<li><p>A timezone if a system timezone was found.</p></li>
<li><p>None if no timezone was found.</p></li>
</ul>
</dd>
</dl>
<p>The extracted timezone can be used to show the local time instead of UTC. e.g.</p>
<spanclass="gp">>>></span><spanclass="nb">print</span><spanclass="p">(</span><spanclass="n">arrow</span><spanclass="o">.</span><spanclass="n">now</span><spanclass="p">(</span><spanclass="n">tz</span><spanclass="o">=</span><spanclass="n">get_system_tz</span><spanclass="p">())</span><spanclass="c1"># prints timezone aware time.</span>
<spanclass="sig-prename descclassname"><spanclass="pre">inkycal.custom.functions.</span></span><spanclass="sig-name descname"><spanclass="pre">internet_available</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.custom.functions.internet_available"title="Permalink to this definition"></a></dt>
<dd><p>checks if the internet is available.</p>
<p>Attempts to connect to google.com with a timeout of 5 seconds to check
if the network can be reached.</p>
<dlclass="simple">
<dt>Returns:</dt><dd><ulclass="simple">
<li><p>True if connection could be established.</p></li>
<li><p>False if the internet could not be reached.</p></li>
</ul>
</dd>
</dl>
<p>Returned output can be used to add a check for internet availability:</p>
<spanclass="sig-prename descclassname"><spanclass="pre">inkycal.custom.functions.</span></span><spanclass="sig-name descname"><spanclass="pre">text_wrap</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">text</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">font</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">max_width</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.custom.functions.text_wrap"title="Permalink to this definition"></a></dt>
<dd><p>Splits a very long text into smaller parts</p>
<p>Splits a long text to smaller lines which can fit in a line with max_width.
Uses a Font object for more accurate calculations.</p>
<dlclass="simple">
<dt>Args:</dt><dd><ulclass="simple">
<li><p>text -> Text as a string</p></li>
<li><p>font: A PIL font object which is used to calculate the size.</p></li>
<li><p>max_width: int-> a width in pixels defining the maximum width before
splitting the text into the next chunk.</p></li>
</ul>
</dd>
<dt>Returns:</dt><dd><p>A list containing chunked strings of the full text.</p>
<spanid="helper-classes"></span><h1>Helper classes<aclass="headerlink"href="#module-inkycal.modules.ical_parser"title="Permalink to this heading"></a></h1>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">inkycal.modules.ical_parser.</span></span><spanclass="sig-name descname"><spanclass="pre">iCalendar</span></span><aclass="headerlink"href="#inkycal.modules.ical_parser.iCalendar"title="Permalink to this definition"></a></dt>
<dd><p>iCalendar parsing moudule for inkycal.
Parses events from given iCalendar URLs / paths</p>
<emclass="property"><spanclass="pre">static</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">all_day</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">event</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.ical_parser.iCalendar.all_day"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">clear_events</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.ical_parser.iCalendar.clear_events"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">get_events</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">timeline_start</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">timeline_end</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">timezone</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.ical_parser.iCalendar.get_events"title="Permalink to this definition"></a></dt>
<dd><p>Input an arrow (time) object for:
* the beginning of timeline (events have to end after this time)
* the end of the timeline (events have to begin before this time)
* timezone if events should be formatted to local time
<emclass="property"><spanclass="pre">static</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">get_system_tz</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.ical_parser.iCalendar.get_system_tz"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">load_from_file</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">filepath</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.ical_parser.iCalendar.load_from_file"title="Permalink to this definition"></a></dt>
<dd><p>Input a string or list of strings containing valid iCalendar filepaths
example: ‘path1’ (single file) OR [‘path1’, ‘path2’] (multiple files)
<spanclass="sig-name descname"><spanclass="pre">load_url</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">url</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">username</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">password</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.ical_parser.iCalendar.load_url"title="Permalink to this definition"></a></dt>
<dd><p>Input a string or list of strings containing valid iCalendar URLs
example: ‘URL1’ (single url) OR [‘URL1’, ‘URL2’] (multiple URLs)
add username and password to access protected files</p>
<spanclass="sig-name descname"><spanclass="pre">show_events</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">fmt</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">'DD</span><spanclass="pre">MMM</span><spanclass="pre">YY</span><spanclass="pre">HH:mm'</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.ical_parser.iCalendar.show_events"title="Permalink to this definition"></a></dt>
<dd><p>print all parsed events in a more readable way
use the format (fmt) parameter to specify the date format
see <aclass="reference external"href="https://arrow.readthedocs.io/en/latest/#supported-tokens">https://arrow.readthedocs.io/en/latest/#supported-tokens</a>
<spanclass="sig-name descname"><spanclass="pre">sort</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.ical_parser.iCalendar.sort"title="Permalink to this definition"></a></dt>
<dd><p>Sort all parsed events in order of beginning time</p>
</dd></dl>
</dd></dl>
<spanclass="target"id="module-inkycal.modules.inky_image"></span><p>Custom image class for Inkycal Project
Takes care of handling images. Made to be used by other modules to handle
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">inkycal.modules.inky_image.</span></span><spanclass="sig-name descname"><spanclass="pre">Inkyimage</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">image</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.inky_image.Inkyimage"title="Permalink to this definition"></a></dt>
<dd><p>Custom Imge class written for commonly used image operations.</p>
<spanclass="sig-name descname"><spanclass="pre">autoflip</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">layout</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.inky_image.Inkyimage.autoflip"title="Permalink to this definition"></a></dt>
<dd><p>flips the image automatically to the given layout.</p>
<dlclass="simple">
<dt>Args:</dt><dd><ulclass="simple">
<li><p>layout:-> str. Choose <cite>horizontal</cite> or <cite>vertical</cite>.</p></li>
</ul>
</dd>
</dl>
<p>Checks the image’s width and height.</p>
<p>In horizontal mode, the image is flipped if the image height is greater
than the image width.</p>
<p>In vertical mode, the image is flipped if the image width is greater
<spanclass="sig-name descname"><spanclass="pre">clear</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.inky_image.Inkyimage.clear"title="Permalink to this definition"></a></dt>
<dd><p>Removes currently saved image if present.</p>
<spanclass="sig-name descname"><spanclass="pre">flip</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">angle</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.inky_image.Inkyimage.flip"title="Permalink to this definition"></a></dt>
<dd><p>Flips the image by the given angle.</p>
<dlclass="simple">
<dt>Args:</dt><dd><ulclass="simple">
<li><p>angle:->int. A multiple of 90, e.g. 90, 180, 270, 360.</p></li>
<spanclass="sig-name descname"><spanclass="pre">load</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">path</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.inky_image.Inkyimage.load"title="Permalink to this definition"></a></dt>
<dd><p>loads an image from a URL or filepath.</p>
<dlclass="simple">
<dt>Args:</dt><dd><ulclass="simple">
<li><p>path:The full path or url of the image file
e.g. <cite>https://sample.com/logo.png</cite> or <cite>/home/pi/Downloads/nice_pic.png</cite></p></li>
</ul>
</dd>
<dt>Raises:</dt><dd><ulclass="simple">
<li><p>FileNotFoundError: This Exception is raised when the file could not be
found.</p></li>
<li><p>OSError: A OSError is raised when the URL doesn’t point to the correct
file-format, i.e. is not an image</p></li>
<li><p>TypeError: if the URLS doesn’t start with htpp</p></li>
<emclass="property"><spanclass="pre">static</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">merge</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">image1</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">image2</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.inky_image.Inkyimage.merge"title="Permalink to this definition"></a></dt>
<dd><p>Merges two images into one.</p>
<p>Replaces white pixels of the first image with transparent ones. Then pastes
the first image on the second one.</p>
<dlclass="simple">
<dt>Args:</dt><dd><ulclass="simple">
<li><p>image1: A PIL Image object in ‘RGBA’ mode.</p></li>
<li><p>image2: A PIL Image object in ‘RGBA’ mode.</p></li>
<emclass="property"><spanclass="pre">static</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">preview</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">image</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.inky_image.Inkyimage.preview"title="Permalink to this definition"></a></dt>
<dd><p>“Previews an image on gpicview (only works on Rapsbian with Desktop).</p>
<spanclass="sig-name descname"><spanclass="pre">remove_alpha</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.inky_image.Inkyimage.remove_alpha"title="Permalink to this definition"></a></dt>
<dd><p>Removes transparency if image has transparency.</p>
<p>Checks if an image has an alpha band and replaces the transparency with
<spanclass="sig-name descname"><spanclass="pre">resize</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">width</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">height</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.inky_image.Inkyimage.resize"title="Permalink to this definition"></a></dt>
<dd><p>Resize an image to desired width or height</p>
<spanclass="sig-name descname"><spanclass="pre">to_palette</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">palette</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">dither</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">True</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#inkycal.modules.inky_image.Inkyimage.to_palette"title="Permalink to this definition"></a></dt>
<dd><p>Maps an image to a given colour palette.</p>
<p>Maps each pixel from the image to a colour from the palette.</p>
<dlclass="simple">
<dt>Args:</dt><dd><ulclass="simple">
<li><p>palette: A supported token. (see below)</p></li>
<li><p>dither:->bool. Use dithering? Set to <cite>False</cite> for solid colour fills.</p></li>
</ul>
</dd>
<dt>Returns:</dt><dd><ulclass="simple">
<li><p>two images: one for the coloured band and one for the black band.</p></li>
</ul>
</dd>
<dt>Raises:</dt><dd><ulclass="simple">
<li><p>ValueError if palette token is not supported</p></li>