Image conversion
#1
Smile 
sir,

i am working on wasp OS where i want to change icons. Is there any software or link of online app present there to convert an image as 1 bit RLE or 2 bit RLE ? and is it possible to change the background black to some image? and if i want to put some logo before the time appears while turning it on what code should i execute.

Thank you so much for helping me out with this things. Smile
#2
The image compressor is ./tools/rle_encode.py and this can be used to convert PNG to RLE. The PNG should be 24-bit with no alpha layer. For 1-bit RLE the image should be strictly black and white (no grey pixels), for 2-bit RLE the image can contain as many colours as you like but the image needs to use spot colours. Textured gradients and photos will not compress efficiently (resulting in an image file that is larger than the available RAM).

Changing the background is entirely up to you... you can write a new clock app and draw whatever you like! Currently all the drawing routines are written in python so if they don't do what you want you can just add your own.

The boot process is basically executing wasp/boards/pinetime/watch.py.in . If you want to manipulate the screen at that point then that is the place to do it.
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
#3
(07-01-2020, 07:34 AM)danielt Wrote: The image compressor is ./tools/rle_encode.py and this can be used to convert PNG to RLE. The PNG should be 24-bit with no alpha layer. For 1-bit RLE the image should be strictly black and white (no grey pixels), for 2-bit RLE the image can contain as many colours as you like but the image needs to use spot colours. Textured gradients and photos will not compress efficiently (resulting in an image file that is larger than the available RAM).

Changing the background is entirely up to you... you can write a new clock app and draw whatever you like! Currently all the drawing routines are written in python so if they don't do what you want you can just add your own.

The boot process is basically executing wasp/boards/pinetime/watch.py.in . If you want to manipulate the screen at that point then that is the place to do it.
sir,

can you share some more details about rle_encode.py, am new to python, don't know how to use it. is there any tutorial or command to implement. how it will take the path of the image for conversion. i am being silly but i didn't got any information in internet. thank you for the help.
#4
(07-01-2020, 07:34 AM)danielt Wrote: The image compressor is ./tools/rle_encode.py and this can be used to convert PNG to RLE. The PNG should be 24-bit with no alpha layer. For 1-bit RLE the image should be strictly black and white (no grey pixels), for 2-bit RLE the image can contain as many colours as you like but the image needs to use spot colours. Textured gradients and photos will not compress efficiently (resulting in an image file that is larger than the available RAM).

Changing the background is entirely up to you... you can write a new clock app and draw whatever you like! Currently all the drawing routines are written in python so if they don't do what you want you can just add your own.

The boot process is basically executing wasp/boards/pinetime/watch.py.in . If you want to manipulate the screen at that point then that is the place to do it.
sir,

i got some exception error while debugging screenshot attached with this mail. how can i proceed converting into rle conversion.
thankyou


Attached Files
.png   Screenshot from 2020-07-08 11-29-52.png (Size: 151.92 KB / Downloads: 374)
#5
It's a command line tool so you should just be able to run it and it will show the results (which can be redirected to a file to avoid having to copy 'n paste from the terminal):


Code:
./tools/rle_encode.py --help
./tools/rle_encode.py --2bit myimage.png > myimage.py
./tools/rle_encode.py --2bit image1.png image2.png image3.png > images.py
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
#6
(07-08-2020, 03:00 AM)danielt Wrote: It's a command line tool so you should just be able to run it and it will show the results (which can be redirected to a file to avoid having to copy 'n paste from the terminal):


Code:
./tools/rle_encode.py --help
./tools/rle_encode.py --2bit myimage.png > myimage.py
./tools/rle_encode.py --2bit image1.png image2.png image3.png > images.py

sir,
After conversion of image 240x240 pixels i tried to implement in the demoApp.py and tried to execute in simulator it crashes. i used this code:

draw._rle2bit(self._logo,20, 20, fg=0xffff, c1=0x4a69, c2=0x7bef)

what could be the reason. i attached the screenshot with this message.

if u can share to convert 1-bit rle. It would be helpful.

thank you.


Attached Files
.png   Screenshot from 2020-07-10 17-27-35.png (Size: 163.11 KB / Downloads: 412)
.png   Screenshot from 2020-07-10 17-37-28.png (Size: 146.41 KB / Downloads: 435)
#7
I can see a couple of things here.

Firstly you are calling the private draw method _rle2bit() rather than the documented blit() method (see https://wasp-os.readthedocs.io/en/latest...ml#drawing ). Additionally you have supplied fg, c1 and c2 arguments instead of relying on their default values.

Secondly you are blitting a full screen image at (x,y) = (20, 20). This will drawing outside the bounds of the display and that provokes an exception.

Try something simpler such as:

Code:
draw.blit(self._logo, 0, 0)

One reason to prefer Draw565.blit() over Draw565._rle2bit() is that the code above should work, without modification for 1-bit images as well.
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
#8
(07-13-2020, 03:14 AM)danielt Wrote: I can see a couple of things here.

Firstly you are calling the private draw method _rle2bit() rather than the documented blit() method (see https://wasp-os.readthedocs.io/en/latest...ml#drawing ). Additionally you have supplied fg, c1 and c2 arguments instead of relying on their default values.

Secondly you are blitting a full screen image at (x,y) = (20, 20). This will drawing outside the bounds of the display and that provokes an exception.

Try something simpler such as:

Code:
draw.blit(self._logo, 0, 0)

One reason to prefer Draw565.blit() over Draw565._rle2bit() is that the code above should work, without modification for 1-bit images as well.


Thankyou so much. It worked !!..


Forum Jump:


Users browsing this thread: 1 Guest(s)