Comments (5)
Hi - I just encountered this issue myself, and was very pleased to see this mapping fix implemented. However, I dug a little deeper into Gimp to find why this was happening with images I prepared. Turns out when the inkyphat palette is imported into Gimp, it is re-ordering the colours so that they are not in the expected order White,Black,Red. Simply opening the colourmap window & re-arranging the colours into the required order has fixed it for me, without using the mapping feature above.
from inky-phat.
How did you prepare your image? You have to pay close attention to the order of the colour palette when exporting- which is frustrating. Photoshop's new export functionality, for example, will totally mess it up, whereas the legacy "Save For Web" does not. D'oh!
I'll have to see if there's a way to fix the colour palettes in these images. I guess it should be simple enough to have a script that opens it, performs a palette swap based on parameters, and saves the result.
from inky-phat.
i tried to follow the instructions (use gimp + custom palette file). i guess i did something wrong. anyway in the end i solved it like this:
img = Image.open('img.png')
img2 = Image.new(mode='P', size=(212, 104))
remapped = []
pxmap = {0: 2, 1:0, 2:1}
for px in img.getdata():
remapped.append(pxmap[px])
img2.putdata(remapped)
inkyphat.set_image(img2)
inkyphat.show()
i guess this can either be closed or flagged as enhancement. having a separate method implementing color indexes rotation would be nice i guess.
from inky-phat.
I'd tend to agree a method that supports colour index rotation would be nice. I'd maybe override set_image
with an optional argument map
or colswap
or something.
from inky-phat.
I experienced this problem also, it was fixed by shackiey's comment. However it also needs to be updated in the documentation at: https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-inky-phat.
There it also states the colour order in "White,Black,Red" en "Black,white, red" in the same page which only confused me.
from inky-phat.
Related Issues (20)
- Documentation about the X,Y layout HOT 2
- Refresh rate? HOT 1
- How to draw lines in black? HOT 1
- inkyphat install failed to install Python library HOT 5
- pillow dependency on stretch-lite HOT 4
- Allow for arbitrary rotation HOT 2
- Waveshare compatibility? HOT 4
- Error with V1 Inkyphat HOT 6
- error on every example- IOError: [Errno 2] No such file or directory HOT 2
- how to display temp in Fahrenheit on inky pHAT HOT 1
- inkyphat.show() is very slow HOT 1
- Change background of the inky phat? HOT 1
- Yahoo Weather API changed HOT 2
- No such file: dev/i2c-1 HOT 1
- How do I rotate text? HOT 4
- icalendar HOT 2
- inkyphat.clear broken HOT 2
- display funkyness after update HOT 4
- Palette Inky-pHAT.gpl has #feffff for white HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inky-phat.