Inky pHAT and Pi newb wanting help on displaying images


#1

Hi, I am new to the Pi and I am new to Python. I have just purchased an Inky pHAT and have it installed on my Pi Zero W okay. I am following the instructions on https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-inky-phat, and have the software installed. I am now at the ‘Displaying images on Inky pHAT’ part of the tutorial and wish to convert an existing image using the instructions. I have done the ‘Git Clone’ bit, but when it says about finding the colour palette at ‘inky-phat/tools/Inky-pHAT.gpl,’ when I input that at terminal I am getting ‘permission denied.’ How do I proceed from here please? Also, I am not getting the next part either, SELECTING the Inky-pHAT.gpl colour palette. I can’t find it following the instructions.

I’d appreciate any and all help. Thanks for your patience and understanding.


#2

You might also be able to grab it with: wget https://raw.githubusercontent.com/pimoroni/inky-phat/master/tools/Inky-pHAT.gpl or simply by visiting this URL and saving it from your browser: https://raw.githubusercontent.com/pimoroni/inky-phat/master/tools/Inky-pHAT.gpl


#3

I have grabbed the content okay. it seemed to have worked both ways; gitclone and wget.

Then when I proceed to the next step, and input “inky-phat/tools/Inky-pHAT.gpl” at terminal, I get “bash: inky-phat/tools/Inky-pHAT.gpl: Permission denied.”

Without this I am unable to proceed to the next step, selecting the Inky-pHAT.gpl colour palette in GIMP.


#4

The line

You’ll find the colour palette at inky-phat/tools/Inky-pHAT.gpl.

Means that’s where to find it, but if you type inky-phat/tools/Inky-pHAT.gpl in the terminal it’ll fail, since that’s a colour palette for GIMP and not an executable file.

You need to move on to:

Select Use custom palette, then click the Palette selection dialogue button. Select Palette file and then select the Inky-pHAT.gpl palette file from the GitHub repo that we just cloned.


#5

Okay, thanks.

When selecting colour palette, where is the Palette selection dialogue button please? I cannot find that or the Palette file Inky-pHAT.gpl in GIMP.

I do apologise if I am being stupid, but I am new to all this.

Thanks for your understanding.


#6

Okay, I can find the Palette Selection dialogue and have highlighted Inky-pHAT.gpl but I cannot then apply it to the image.


#7

Scratch that I can’t import it. Please help.


#8

It’s the fiddley little arrow on the right of the Palette Selection Dialogue. You need to go to “Palettes Menu” then “Import Palette” then finally click the radio next to “Palette File” and pick the file. I’m trying to grab some screenshots.


#9

Switch image to Indexed Mode:

Use a custom palette and hit the Palette Selection Menu icon in the bottom right:

Then the tiny Configure this Tab arrow:

Then go to Import:

Choose file:

Navigate to Inky-pHAT.gpl

And open it:

Hitting import should take you back to here:

Now close the dialogue and re-open using the first two steps because GIMP is weird and wont show the Palette in the menu until the dialogue is reloaded :(

Hopefully this helps. I’ve got to dash!


#10

Thank you very much, that has helped with creating the image.

Now when I follow the rest of the instructions I get this:

import inkyphat
from PIL import Image
inkyphat.set_image(Image.open("/home/pi/Pictures/hellboycrap.png"))
Traceback (most recent call last):
File “”, line 1, in
File “/usr/lib/python2.7/dist-packages/inkyphat/init.py”, line 99, in set_image
_image.paste(image)
File “/usr/lib/python2.7/dist-packages/PIL/Image.py”, line 1334, in paste
self.im.paste(im, box)
ValueError: images do not match


#11

Saved out as an 8bit png? Got naught but my phone for the next 4 hours or so, so I may not be much use!


#12

Thanks Phil, I managed to get there in the end. I appreciate your patience
and understanding

Jon