Skip to content

mrusme/image2kiwi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image2kiwi

Converter from Images (JPEG, PNG, GIF, ...) into Kiwi frames JSON-arrays.

Installation

$ # Optional
$ mkvirtualenv -p python3 image2kiwi
$ # Install Pillow
$ pip3 install pillow

Usage

$ python3 ./image2kiwi <imagefile> ...

E.g.

$ python3 ./image2kiwi ~/Desktop/rainbow.gif

Output:

[{"keys": {"key_1_in_row_1": {"red": 70, "green": 81, "blue": 184}, "key_1_in_row_2": {"red": 116, "green": 204, "blue": 138}, "key_1_in_row_3": {"red": 82, "green": 185, "blue": 173}, "key_2_in_row_1": {"red": 49, "green": 117, "blue": 205}, "key_2_in_row_2": {"red": 127, "green": 128, "blue": 127}, "key_2_in_row_3": {"red": 205, "green": 136, "blue": 49}, "key_3_in_row_1": {"red": 172, "green": 69, "blue": 82}, "key_3_in_row_2": {"red": 136, "green": 49, "blue": 118}, "key_3_in_row_3": {"red": 185, "green": 172, "blue": 69}}, "sleep": 250}, {"keys": {"key_1_in_row_1": {"red": 82, "green": 185, "blue": 173}, "key_1_in_row_2": {"red": 205, "green": 137, "blue": 49}, "key_1_in_row_3": {"red": 185, "green": 172, "blue": 69}, "key_2_in_row_1": {"red": 117, "green": 204, "blue": 137}, "key_2_in_row_2": {"red": 127, "green": 128, "blue": 127}, "key_2_in_row_3": {"red": 136, "green": 49, "blue": 119}, "key_3_in_row_1": {"red": 70, "green": 81, "blue": 184}, "key_3_in_row_2": {"red": 49, "green": 117, "blue": 205}, "key_3_in_row_3": {"red": 172, "green": 70, "blue": 82}}, "sleep": 250}, {"keys": {"key_1_in_row_1": {"red": 185, "green": 172, "blue": 69}, "key_1_in_row_2": {"red": 136, "green": 49, "blue": 118}, "key_1_in_row_3": {"red": 172, "green": 69, "blue": 82}, "key_2_in_row_1": {"red": 205, "green": 136, "blue": 49}, "key_2_in_row_2": {"red": 127, "green": 128, "blue": 127}, "key_2_in_row_3": {"red": 50, "green": 117, "blue": 205}, "key_3_in_row_1": {"red": 82, "green": 185, "blue": 173}, "key_3_in_row_2": {"red": 116, "green": 204, "blue": 138}, "key_3_in_row_3": {"red": 70, "green": 81, "blue": 184}}, "sleep": 250}, {"keys": {"key_1_in_row_1": {"red": 172, "green": 69, "blue": 82}, "key_1_in_row_2": {"red": 49, "green": 117, "blue": 205}, "key_1_in_row_3": {"red": 70, "green": 81, "blue": 184}, "key_2_in_row_1": {"red": 136, "green": 49, "blue": 119}, "key_2_in_row_2": {"red": 127, "green": 128, "blue": 127}, "key_2_in_row_3": {"red": 117, "green": 204, "blue": 137}, "key_3_in_row_1": {"red": 185, "green": 172, "blue": 69}, "key_3_in_row_2": {"red": 205, "green": 136, "blue": 49}, "key_3_in_row_3": {"red": 82, "green": 185, "blue": 172}}, "sleep": 250}]

This output can be used to set Kiwi key animations. Please refer to the Kiwi documentation for more info.

Multiple images

If you don't have a GIF but still want an animation, you can simply select mulitple images and have image2kiwi generate you an animation from them:

$ python3 ./image2kiwi ~/Desktop/image1.jpg ~/Desktop/image2.jpg ~/Desktop/image3.jpg

One large image

Pimoroni provides a couple of animation patterns in their firmware which are basically large images that are being cropped into individual frames during runtime. In order to allow converting these type of images into the Kiwi animation JSON format as well, image2kiwi provides two options:

  • --split-horizontally for splitting an image that's wider than long ()
  • --split-vertically for splitting an image that's longer than wide (|)

Example:

$ python3 ./image2kiwi.py --show-frame-for-ms 100 --split-horizontally ./animated-pastel-rainbow.png

Output:

[{"keys": {"key_1_in_row_1": {"red": 184, "green": 213, "blue": 208}, "key_1_in_row_2": {"red": 170, "green": 208, "blue": 216}, "key_1_in_row_3": {"red": 155, "green": 203, "blue": 223}, "key_1_in_row_4": {"red": 140, "green": 199, "blue": 229}, "key_2_in_row_1": {"red": 188, "green": 215, "blue": 206}, "key_2_in_row_2": {"red": 174, "green": 210, "blue": 214}, "key_2_in_row_3": {"red": 159, "green": 205, "blue": 221}, "key_2_in_row_4": {"red": 143, "green": 200, "blue": 227}, "key_3_in_row_1": {"red": 192, "green": 216, "blue": 204}, "key_3_in_row_2": {"red": 179, "green": 211, "blue": 211}, "key_3_in_row_3": {"red": 164, "green": 206, "blue": 218}, "key_3_in_row_4": {"red": 148, "green": 201, "blue": 225}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 196, "green": 217, "blue": 202}, "key_1_in_row_2": {"red": 183, "green": 213, "blue": 209}, "key_1_in_row_3": {"red": 168, "green": 208, "blue": 216}, "key_1_in_row_4": {"red": 152, "green": 203, "blue": 224}, "key_2_in_row_1": {"red": 199, "green": 218, "blue": 199}, "key_2_in_row_2": {"red": 187, "green": 214, "blue": 207}, "key_2_in_row_3": {"red": 173, "green": 209, "blue": 214}, "key_2_in_row_4": {"red": 157, "green": 204, "blue": 221}, "key_3_in_row_1": {"red": 203, "green": 219, "blue": 197}, "key_3_in_row_2": {"red": 190, "green": 215, "blue": 205}, "key_3_in_row_3": {"red": 177, "green": 211, "blue": 212}, "key_3_in_row_4": {"red": 162, "green": 206, "blue": 220}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 206, "green": 220, "blue": 195}, "key_1_in_row_2": {"red": 194, "green": 216, "blue": 203}, "key_1_in_row_3": {"red": 182, "green": 212, "blue": 210}, "key_1_in_row_4": {"red": 166, "green": 207, "blue": 217}, "key_2_in_row_1": {"red": 209, "green": 222, "blue": 192}, "key_2_in_row_2": {"red": 198, "green": 217, "blue": 200}, "key_2_in_row_3": {"red": 186, "green": 213, "blue": 208}, "key_2_in_row_4": {"red": 171, "green": 209, "blue": 215}, "key_3_in_row_1": {"red": 213, "green": 223, "blue": 189}, "key_3_in_row_2": {"red": 201, "green": 218, "blue": 198}, "key_3_in_row_3": {"red": 189, "green": 215, "blue": 206}, "key_3_in_row_4": {"red": 175, "green": 210, "blue": 213}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 216, "green": 225, "blue": 186}, "key_1_in_row_2": {"red": 205, "green": 220, "blue": 196}, "key_1_in_row_3": {"red": 193, "green": 216, "blue": 203}, "key_1_in_row_4": {"red": 180, "green": 212, "blue": 211}, "key_2_in_row_1": {"red": 219, "green": 226, "blue": 183}, "key_2_in_row_2": {"red": 208, "green": 221, "blue": 193}, "key_2_in_row_3": {"red": 197, "green": 217, "blue": 201}, "key_2_in_row_4": {"red": 184, "green": 213, "blue": 209}, "key_3_in_row_1": {"red": 223, "green": 228, "blue": 180}, "key_3_in_row_2": {"red": 211, "green": 222, "blue": 190}, "key_3_in_row_3": {"red": 200, "green": 218, "blue": 199}, "key_3_in_row_4": {"red": 187, "green": 214, "blue": 207}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 226, "green": 229, "blue": 177}, "key_1_in_row_2": {"red": 214, "green": 224, "blue": 187}, "key_1_in_row_3": {"red": 203, "green": 219, "blue": 197}, "key_1_in_row_4": {"red": 191, "green": 215, "blue": 205}, "key_2_in_row_1": {"red": 229, "green": 230, "blue": 174}, "key_2_in_row_2": {"red": 218, "green": 226, "blue": 185}, "key_2_in_row_3": {"red": 207, "green": 220, "blue": 194}, "key_2_in_row_4": {"red": 195, "green": 216, "blue": 202}, "key_3_in_row_1": {"red": 233, "green": 232, "blue": 171}, "key_3_in_row_2": {"red": 221, "green": 227, "blue": 181}, "key_3_in_row_3": {"red": 210, "green": 222, "blue": 191}, "key_3_in_row_4": {"red": 199, "green": 217, "blue": 200}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 235, "green": 233, "blue": 168}, "key_1_in_row_2": {"red": 225, "green": 229, "blue": 178}, "key_1_in_row_3": {"red": 214, "green": 223, "blue": 188}, "key_1_in_row_4": {"red": 202, "green": 219, "blue": 198}, "key_2_in_row_1": {"red": 238, "green": 234, "blue": 166}, "key_2_in_row_2": {"red": 228, "green": 230, "blue": 175}, "key_2_in_row_3": {"red": 217, "green": 225, "blue": 185}, "key_2_in_row_4": {"red": 205, "green": 220, "blue": 195}, "key_3_in_row_1": {"red": 240, "green": 235, "blue": 164}, "key_3_in_row_2": {"red": 231, "green": 232, "blue": 172}, "key_3_in_row_3": {"red": 220, "green": 227, "blue": 182}, "key_3_in_row_4": {"red": 209, "green": 221, "blue": 192}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 243, "green": 236, "blue": 161}, "key_1_in_row_2": {"red": 234, "green": 233, "blue": 169}, "key_1_in_row_3": {"red": 224, "green": 228, "blue": 179}, "key_1_in_row_4": {"red": 212, "green": 223, "blue": 189}, "key_2_in_row_1": {"red": 245, "green": 236, "blue": 159}, "key_2_in_row_2": {"red": 237, "green": 234, "blue": 167}, "key_2_in_row_3": {"red": 227, "green": 230, "blue": 176}, "key_2_in_row_4": {"red": 216, "green": 225, "blue": 187}, "key_3_in_row_1": {"red": 247, "green": 236, "blue": 158}, "key_3_in_row_2": {"red": 240, "green": 235, "blue": 164}, "key_3_in_row_3": {"red": 230, "green": 231, "blue": 173}, "key_3_in_row_4": {"red": 219, "green": 226, "blue": 184}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 248, "green": 236, "blue": 156}, "key_1_in_row_2": {"red": 242, "green": 235, "blue": 162}, "key_1_in_row_3": {"red": 233, "green": 233, "blue": 170}, "key_1_in_row_4": {"red": 223, "green": 228, "blue": 180}, "key_2_in_row_1": {"red": 250, "green": 236, "blue": 155}, "key_2_in_row_2": {"red": 244, "green": 236, "blue": 160}, "key_2_in_row_3": {"red": 236, "green": 234, "blue": 167}, "key_2_in_row_4": {"red": 226, "green": 229, "blue": 177}, "key_3_in_row_1": {"red": 251, "green": 235, "blue": 155}, "key_3_in_row_2": {"red": 246, "green": 237, "blue": 158}, "key_3_in_row_3": {"red": 239, "green": 235, "blue": 165}, "key_3_in_row_4": {"red": 229, "green": 230, "blue": 174}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 251, "green": 235, "blue": 155}, "key_1_in_row_2": {"red": 248, "green": 237, "blue": 156}, "key_1_in_row_3": {"red": 241, "green": 235, "blue": 163}, "key_1_in_row_4": {"red": 232, "green": 232, "blue": 171}, "key_2_in_row_1": {"red": 251, "green": 234, "blue": 155}, "key_2_in_row_2": {"red": 249, "green": 236, "blue": 156}, "key_2_in_row_3": {"red": 243, "green": 236, "blue": 161}, "key_2_in_row_4": {"red": 235, "green": 233, "blue": 169}, "key_3_in_row_1": {"red": 251, "green": 232, "blue": 156}, "key_3_in_row_2": {"red": 250, "green": 236, "blue": 155}, "key_3_in_row_3": {"red": 246, "green": 236, "blue": 159}, "key_3_in_row_4": {"red": 237, "green": 234, "blue": 166}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 251, "green": 231, "blue": 157}, "key_1_in_row_2": {"red": 251, "green": 235, "blue": 155}, "key_1_in_row_3": {"red": 248, "green": 236, "blue": 157}, "key_1_in_row_4": {"red": 240, "green": 235, "blue": 164}, "key_2_in_row_1": {"red": 251, "green": 229, "blue": 158}, "key_2_in_row_2": {"red": 251, "green": 234, "blue": 155}, "key_2_in_row_3": {"red": 249, "green": 236, "blue": 156}, "key_2_in_row_4": {"red": 243, "green": 235, "blue": 161}, "key_3_in_row_1": {"red": 251, "green": 227, "blue": 160}, "key_3_in_row_2": {"red": 251, "green": 233, "blue": 155}, "key_3_in_row_3": {"red": 250, "green": 236, "blue": 155}, "key_3_in_row_4": {"red": 245, "green": 236, "blue": 159}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 251, "green": 224, "blue": 161}, "key_1_in_row_2": {"red": 251, "green": 232, "blue": 156}, "key_1_in_row_3": {"red": 251, "green": 235, "blue": 155}, "key_1_in_row_4": {"red": 247, "green": 236, "blue": 158}, "key_2_in_row_1": {"red": 251, "green": 222, "blue": 163}, "key_2_in_row_2": {"red": 251, "green": 230, "blue": 158}, "key_2_in_row_3": {"red": 251, "green": 235, "blue": 154}, "key_2_in_row_4": {"red": 248, "green": 236, "blue": 157}, "key_3_in_row_1": {"red": 251, "green": 220, "blue": 165}, "key_3_in_row_2": {"red": 251, "green": 228, "blue": 159}, "key_3_in_row_3": {"red": 251, "green": 234, "blue": 155}, "key_3_in_row_4": {"red": 250, "green": 236, "blue": 156}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 251, "green": 217, "blue": 167}, "key_1_in_row_2": {"red": 251, "green": 225, "blue": 160}, "key_1_in_row_3": {"red": 251, "green": 232, "blue": 156}, "key_1_in_row_4": {"red": 250, "green": 236, "blue": 155}, "key_2_in_row_1": {"red": 250, "green": 215, "blue": 169}, "key_2_in_row_2": {"red": 251, "green": 223, "blue": 162}, "key_2_in_row_3": {"red": 251, "green": 230, "blue": 157}, "key_2_in_row_4": {"red": 251, "green": 235, "blue": 155}, "key_3_in_row_1": {"red": 249, "green": 212, "blue": 171}, "key_3_in_row_2": {"red": 251, "green": 221, "blue": 164}, "key_3_in_row_3": {"red": 251, "green": 228, "blue": 159}, "key_3_in_row_4": {"red": 251, "green": 234, "blue": 155}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 249, "green": 209, "blue": 172}, "key_1_in_row_2": {"red": 251, "green": 218, "blue": 166}, "key_1_in_row_3": {"red": 251, "green": 226, "blue": 160}, "key_1_in_row_4": {"red": 251, "green": 233, "blue": 156}, "key_2_in_row_1": {"red": 248, "green": 207, "blue": 175}, "key_2_in_row_2": {"red": 251, "green": 216, "blue": 168}, "key_2_in_row_3": {"red": 251, "green": 224, "blue": 161}, "key_2_in_row_4": {"red": 251, "green": 231, "blue": 157}, "key_3_in_row_1": {"red": 247, "green": 204, "blue": 176}, "key_3_in_row_2": {"red": 250, "green": 213, "blue": 170}, "key_3_in_row_3": {"red": 250, "green": 221, "blue": 163}, "key_3_in_row_4": {"red": 251, "green": 229, "blue": 158}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 246, "green": 202, "blue": 177}, "key_1_in_row_2": {"red": 249, "green": 211, "blue": 172}, "key_1_in_row_3": {"red": 251, "green": 219, "blue": 165}, "key_1_in_row_4": {"red": 251, "green": 227, "blue": 159}, "key_2_in_row_1": {"red": 246, "green": 199, "blue": 179}, "key_2_in_row_2": {"red": 249, "green": 208, "blue": 174}, "key_2_in_row_3": {"red": 250, "green": 217, "blue": 167}, "key_2_in_row_4": {"red": 251, "green": 225, "blue": 161}, "key_3_in_row_1": {"red": 245, "green": 197, "blue": 180}, "key_3_in_row_2": {"red": 248, "green": 206, "blue": 175}, "key_3_in_row_3": {"red": 250, "green": 214, "blue": 169}, "key_3_in_row_4": {"red": 251, "green": 222, "blue": 163}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 245, "green": 195, "blue": 181}, "key_1_in_row_2": {"red": 247, "green": 203, "blue": 177}, "key_1_in_row_3": {"red": 249, "green": 211, "blue": 171}, "key_1_in_row_4": {"red": 250, "green": 220, "blue": 165}, "key_2_in_row_1": {"red": 245, "green": 192, "blue": 181}, "key_2_in_row_2": {"red": 246, "green": 200, "blue": 178}, "key_2_in_row_3": {"red": 248, "green": 209, "blue": 173}, "key_2_in_row_4": {"red": 250, "green": 218, "blue": 166}, "key_3_in_row_1": {"red": 244, "green": 190, "blue": 182}, "key_3_in_row_2": {"red": 246, "green": 198, "blue": 179}, "key_3_in_row_3": {"red": 247, "green": 206, "blue": 175}, "key_3_in_row_4": {"red": 250, "green": 215, "blue": 168}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 244, "green": 187, "blue": 183}, "key_1_in_row_2": {"red": 246, "green": 195, "blue": 180}, "key_1_in_row_3": {"red": 247, "green": 204, "blue": 177}, "key_1_in_row_4": {"red": 249, "green": 212, "blue": 170}, "key_2_in_row_1": {"red": 245, "green": 185, "blue": 183}, "key_2_in_row_2": {"red": 245, "green": 193, "blue": 181}, "key_2_in_row_3": {"red": 246, "green": 201, "blue": 178}, "key_2_in_row_4": {"red": 249, "green": 210, "blue": 172}, "key_3_in_row_1": {"red": 244, "green": 182, "blue": 183}, "key_3_in_row_2": {"red": 245, "green": 191, "blue": 182}, "key_3_in_row_3": {"red": 246, "green": 198, "blue": 180}, "key_3_in_row_4": {"red": 248, "green": 208, "blue": 174}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 244, "green": 180, "blue": 183}, "key_1_in_row_2": {"red": 244, "green": 188, "blue": 183}, "key_1_in_row_3": {"red": 245, "green": 196, "blue": 180}, "key_1_in_row_4": {"red": 247, "green": 205, "blue": 176}, "key_2_in_row_1": {"red": 243, "green": 177, "blue": 184}, "key_2_in_row_2": {"red": 244, "green": 186, "blue": 183}, "key_2_in_row_3": {"red": 245, "green": 194, "blue": 181}, "key_2_in_row_4": {"red": 247, "green": 202, "blue": 177}, "key_3_in_row_1": {"red": 243, "green": 174, "blue": 184}, "key_3_in_row_2": {"red": 244, "green": 183, "blue": 183}, "key_3_in_row_3": {"red": 244, "green": 192, "blue": 182}, "key_3_in_row_4": {"red": 246, "green": 200, "blue": 179}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 243, "green": 172, "blue": 185}, "key_1_in_row_2": {"red": 244, "green": 181, "blue": 183}, "key_1_in_row_3": {"red": 245, "green": 189, "blue": 183}, "key_1_in_row_4": {"red": 246, "green": 197, "blue": 180}, "key_2_in_row_1": {"red": 243, "green": 170, "blue": 187}, "key_2_in_row_2": {"red": 244, "green": 178, "blue": 183}, "key_2_in_row_3": {"red": 245, "green": 187, "blue": 183}, "key_2_in_row_4": {"red": 245, "green": 195, "blue": 181}, "key_3_in_row_1": {"red": 243, "green": 168, "blue": 188}, "key_3_in_row_2": {"red": 244, "green": 176, "blue": 184}, "key_3_in_row_3": {"red": 244, "green": 184, "blue": 183}, "key_3_in_row_4": {"red": 245, "green": 193, "blue": 181}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 243, "green": 166, "blue": 189}, "key_1_in_row_2": {"red": 243, "green": 173, "blue": 185}, "key_1_in_row_3": {"red": 244, "green": 182, "blue": 183}, "key_1_in_row_4": {"red": 245, "green": 190, "blue": 182}, "key_2_in_row_1": {"red": 243, "green": 165, "blue": 190}, "key_2_in_row_2": {"red": 243, "green": 170, "blue": 187}, "key_2_in_row_3": {"red": 243, "green": 179, "blue": 183}, "key_2_in_row_4": {"red": 244, "green": 187, "blue": 182}, "key_3_in_row_1": {"red": 243, "green": 165, "blue": 189}, "key_3_in_row_2": {"red": 243, "green": 168, "blue": 188}, "key_3_in_row_3": {"red": 243, "green": 176, "blue": 183}, "key_3_in_row_4": {"red": 244, "green": 185, "blue": 183}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 243, "green": 164, "blue": 188}, "key_1_in_row_2": {"red": 243, "green": 166, "blue": 189}, "key_1_in_row_3": {"red": 243, "green": 173, "blue": 185}, "key_1_in_row_4": {"red": 244, "green": 183, "blue": 183}, "key_2_in_row_1": {"red": 243, "green": 165, "blue": 187}, "key_2_in_row_2": {"red": 243, "green": 165, "blue": 190}, "key_2_in_row_3": {"red": 243, "green": 171, "blue": 186}, "key_2_in_row_4": {"red": 244, "green": 181, "blue": 183}, "key_3_in_row_1": {"red": 243, "green": 166, "blue": 186}, "key_3_in_row_2": {"red": 243, "green": 164, "blue": 189}, "key_3_in_row_3": {"red": 243, "green": 169, "blue": 188}, "key_3_in_row_4": {"red": 243, "green": 178, "blue": 183}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 243, "green": 167, "blue": 185}, "key_1_in_row_2": {"red": 243, "green": 164, "blue": 189}, "key_1_in_row_3": {"red": 243, "green": 167, "blue": 189}, "key_1_in_row_4": {"red": 244, "green": 175, "blue": 184}, "key_2_in_row_1": {"red": 243, "green": 169, "blue": 184}, "key_2_in_row_2": {"red": 243, "green": 164, "blue": 187}, "key_2_in_row_3": {"red": 243, "green": 165, "blue": 190}, "key_2_in_row_4": {"red": 243, "green": 172, "blue": 185}, "key_3_in_row_1": {"red": 243, "green": 171, "blue": 184}, "key_3_in_row_2": {"red": 243, "green": 165, "blue": 186}, "key_3_in_row_3": {"red": 243, "green": 164, "blue": 189}, "key_3_in_row_4": {"red": 243, "green": 170, "blue": 187}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 244, "green": 173, "blue": 183}, "key_1_in_row_2": {"red": 243, "green": 166, "blue": 185}, "key_1_in_row_3": {"red": 243, "green": 164, "blue": 189}, "key_1_in_row_4": {"red": 243, "green": 168, "blue": 189}, "key_2_in_row_1": {"red": 244, "green": 176, "blue": 183}, "key_2_in_row_2": {"red": 243, "green": 168, "blue": 184}, "key_2_in_row_3": {"red": 242, "green": 164, "blue": 188}, "key_2_in_row_4": {"red": 243, "green": 167, "blue": 189}, "key_3_in_row_1": {"red": 244, "green": 178, "blue": 183}, "key_3_in_row_2": {"red": 243, "green": 170, "blue": 184}, "key_3_in_row_3": {"red": 242, "green": 165, "blue": 187}, "key_3_in_row_4": {"red": 243, "green": 165, "blue": 190}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 244, "green": 180, "blue": 183}, "key_1_in_row_2": {"red": 243, "green": 172, "blue": 183}, "key_1_in_row_3": {"red": 242, "green": 166, "blue": 185}, "key_1_in_row_4": {"red": 243, "green": 165, "blue": 189}, "key_2_in_row_1": {"red": 244, "green": 183, "blue": 183}, "key_2_in_row_2": {"red": 244, "green": 174, "blue": 183}, "key_2_in_row_3": {"red": 242, "green": 167, "blue": 185}, "key_2_in_row_4": {"red": 243, "green": 164, "blue": 188}, "key_3_in_row_1": {"red": 245, "green": 186, "blue": 183}, "key_3_in_row_2": {"red": 244, "green": 177, "blue": 183}, "key_3_in_row_3": {"red": 243, "green": 169, "blue": 184}, "key_3_in_row_4": {"red": 243, "green": 165, "blue": 187}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 245, "green": 188, "blue": 182}, "key_1_in_row_2": {"red": 244, "green": 180, "blue": 183}, "key_1_in_row_3": {"red": 243, "green": 171, "blue": 184}, "key_1_in_row_4": {"red": 243, "green": 166, "blue": 186}, "key_2_in_row_1": {"red": 245, "green": 190, "blue": 182}, "key_2_in_row_2": {"red": 244, "green": 182, "blue": 183}, "key_2_in_row_3": {"red": 244, "green": 174, "blue": 183}, "key_2_in_row_4": {"red": 243, "green": 167, "blue": 185}, "key_3_in_row_1": {"red": 245, "green": 192, "blue": 181}, "key_3_in_row_2": {"red": 244, "green": 185, "blue": 183}, "key_3_in_row_3": {"red": 244, "green": 176, "blue": 183}, "key_3_in_row_4": {"red": 243, "green": 168, "blue": 184}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 245, "green": 194, "blue": 181}, "key_1_in_row_2": {"red": 244, "green": 187, "blue": 182}, "key_1_in_row_3": {"red": 244, "green": 179, "blue": 183}, "key_1_in_row_4": {"red": 243, "green": 171, "blue": 184}, "key_2_in_row_1": {"red": 246, "green": 196, "blue": 180}, "key_2_in_row_2": {"red": 245, "green": 189, "blue": 182}, "key_2_in_row_3": {"red": 244, "green": 181, "blue": 183}, "key_2_in_row_4": {"red": 243, "green": 173, "blue": 183}, "key_3_in_row_1": {"red": 246, "green": 198, "blue": 179}, "key_3_in_row_2": {"red": 245, "green": 191, "blue": 182}, "key_3_in_row_3": {"red": 244, "green": 183, "blue": 182}, "key_3_in_row_4": {"red": 244, "green": 175, "blue": 183}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 246, "green": 201, "blue": 178}, "key_1_in_row_2": {"red": 245, "green": 193, "blue": 181}, "key_1_in_row_3": {"red": 245, "green": 186, "blue": 182}, "key_1_in_row_4": {"red": 244, "green": 178, "blue": 183}, "key_2_in_row_1": {"red": 247, "green": 203, "blue": 177}, "key_2_in_row_2": {"red": 245, "green": 195, "blue": 180}, "key_2_in_row_3": {"red": 245, "green": 188, "blue": 182}, "key_2_in_row_4": {"red": 244, "green": 180, "blue": 183}, "key_3_in_row_1": {"red": 247, "green": 205, "blue": 176}, "key_3_in_row_2": {"red": 246, "green": 198, "blue": 180}, "key_3_in_row_3": {"red": 245, "green": 190, "blue": 182}, "key_3_in_row_4": {"red": 244, "green": 183, "blue": 183}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 247, "green": 207, "blue": 174}, "key_1_in_row_2": {"red": 246, "green": 199, "blue": 179}, "key_1_in_row_3": {"red": 245, "green": 193, "blue": 181}, "key_1_in_row_4": {"red": 245, "green": 185, "blue": 183}, "key_2_in_row_1": {"red": 248, "green": 209, "blue": 173}, "key_2_in_row_2": {"red": 246, "green": 202, "blue": 178}, "key_2_in_row_3": {"red": 245, "green": 195, "blue": 181}, "key_2_in_row_4": {"red": 245, "green": 188, "blue": 183}, "key_3_in_row_1": {"red": 248, "green": 211, "blue": 171}, "key_3_in_row_2": {"red": 247, "green": 204, "blue": 176}, "key_3_in_row_3": {"red": 245, "green": 197, "blue": 180}, "key_3_in_row_4": {"red": 245, "green": 190, "blue": 182}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 249, "green": 213, "blue": 169}, "key_1_in_row_2": {"red": 247, "green": 206, "blue": 175}, "key_1_in_row_3": {"red": 246, "green": 199, "blue": 179}, "key_1_in_row_4": {"red": 245, "green": 192, "blue": 182}, "key_2_in_row_1": {"red": 249, "green": 216, "blue": 167}, "key_2_in_row_2": {"red": 248, "green": 208, "blue": 174}, "key_2_in_row_3": {"red": 246, "green": 201, "blue": 178}, "key_2_in_row_4": {"red": 246, "green": 194, "blue": 181}, "key_3_in_row_1": {"red": 250, "green": 218, "blue": 165}, "key_3_in_row_2": {"red": 249, "green": 210, "blue": 172}, "key_3_in_row_3": {"red": 247, "green": 203, "blue": 177}, "key_3_in_row_4": {"red": 246, "green": 196, "blue": 180}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 251, "green": 220, "blue": 164}, "key_1_in_row_2": {"red": 249, "green": 212, "blue": 170}, "key_1_in_row_3": {"red": 247, "green": 205, "blue": 176}, "key_1_in_row_4": {"red": 246, "green": 198, "blue": 179}, "key_2_in_row_1": {"red": 251, "green": 222, "blue": 163}, "key_2_in_row_2": {"red": 250, "green": 215, "blue": 168}, "key_2_in_row_3": {"red": 248, "green": 208, "blue": 174}, "key_2_in_row_4": {"red": 246, "green": 200, "blue": 178}, "key_3_in_row_1": {"red": 251, "green": 225, "blue": 161}, "key_3_in_row_2": {"red": 250, "green": 217, "blue": 166}, "key_3_in_row_3": {"red": 248, "green": 210, "blue": 172}, "key_3_in_row_4": {"red": 246, "green": 203, "blue": 177}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 251, "green": 226, "blue": 159}, "key_1_in_row_2": {"red": 250, "green": 219, "blue": 165}, "key_1_in_row_3": {"red": 249, "green": 212, "blue": 171}, "key_1_in_row_4": {"red": 247, "green": 205, "blue": 176}, "key_2_in_row_1": {"red": 250, "green": 228, "blue": 158}, "key_2_in_row_2": {"red": 251, "green": 221, "blue": 163}, "key_2_in_row_3": {"red": 249, "green": 214, "blue": 169}, "key_2_in_row_4": {"red": 248, "green": 207, "blue": 174}, "key_3_in_row_1": {"red": 251, "green": 230, "blue": 157}, "key_3_in_row_2": {"red": 251, "green": 224, "blue": 161}, "key_3_in_row_3": {"red": 250, "green": 216, "blue": 167}, "key_3_in_row_4": {"red": 248, "green": 209, "blue": 173}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 251, "green": 232, "blue": 156}, "key_1_in_row_2": {"red": 251, "green": 226, "blue": 160}, "key_1_in_row_3": {"red": 250, "green": 218, "blue": 165}, "key_1_in_row_4": {"red": 248, "green": 211, "blue": 171}, "key_2_in_row_1": {"red": 251, "green": 233, "blue": 155}, "key_2_in_row_2": {"red": 251, "green": 228, "blue": 159}, "key_2_in_row_3": {"red": 250, "green": 220, "blue": 163}, "key_2_in_row_4": {"red": 249, "green": 213, "blue": 170}, "key_3_in_row_1": {"red": 251, "green": 234, "blue": 155}, "key_3_in_row_2": {"red": 251, "green": 229, "blue": 157}, "key_3_in_row_3": {"red": 251, "green": 223, "blue": 162}, "key_3_in_row_4": {"red": 250, "green": 215, "blue": 168}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 251, "green": 235, "blue": 155}, "key_1_in_row_2": {"red": 251, "green": 231, "blue": 156}, "key_1_in_row_3": {"red": 251, "green": 225, "blue": 161}, "key_1_in_row_4": {"red": 250, "green": 217, "blue": 166}, "key_2_in_row_1": {"red": 250, "green": 236, "blue": 155}, "key_2_in_row_2": {"red": 251, "green": 233, "blue": 156}, "key_2_in_row_3": {"red": 251, "green": 227, "blue": 160}, "key_2_in_row_4": {"red": 251, "green": 220, "blue": 164}, "key_3_in_row_1": {"red": 250, "green": 236, "blue": 155}, "key_3_in_row_2": {"red": 251, "green": 234, "blue": 155}, "key_3_in_row_3": {"red": 251, "green": 229, "blue": 158}, "key_3_in_row_4": {"red": 251, "green": 222, "blue": 162}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 249, "green": 237, "blue": 156}, "key_1_in_row_2": {"red": 251, "green": 235, "blue": 155}, "key_1_in_row_3": {"red": 251, "green": 231, "blue": 157}, "key_1_in_row_4": {"red": 251, "green": 224, "blue": 161}, "key_2_in_row_1": {"red": 248, "green": 237, "blue": 157}, "key_2_in_row_2": {"red": 251, "green": 236, "blue": 155}, "key_2_in_row_3": {"red": 251, "green": 232, "blue": 156}, "key_2_in_row_4": {"red": 251, "green": 226, "blue": 160}, "key_3_in_row_1": {"red": 246, "green": 236, "blue": 158}, "key_3_in_row_2": {"red": 250, "green": 236, "blue": 155}, "key_3_in_row_3": {"red": 251, "green": 233, "blue": 155}, "key_3_in_row_4": {"red": 251, "green": 228, "blue": 159}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 244, "green": 235, "blue": 160}, "key_1_in_row_2": {"red": 249, "green": 236, "blue": 155}, "key_1_in_row_3": {"red": 251, "green": 234, "blue": 155}, "key_1_in_row_4": {"red": 251, "green": 230, "blue": 157}, "key_2_in_row_1": {"red": 242, "green": 235, "blue": 161}, "key_2_in_row_2": {"red": 249, "green": 236, "blue": 156}, "key_2_in_row_3": {"red": 251, "green": 235, "blue": 155}, "key_2_in_row_4": {"red": 251, "green": 231, "blue": 156}, "key_3_in_row_1": {"red": 240, "green": 234, "blue": 163}, "key_3_in_row_2": {"red": 247, "green": 236, "blue": 158}, "key_3_in_row_3": {"red": 251, "green": 236, "blue": 155}, "key_3_in_row_4": {"red": 251, "green": 232, "blue": 155}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 238, "green": 234, "blue": 165}, "key_1_in_row_2": {"red": 246, "green": 236, "blue": 159}, "key_1_in_row_3": {"red": 250, "green": 236, "blue": 155}, "key_1_in_row_4": {"red": 251, "green": 234, "blue": 155}, "key_2_in_row_1": {"red": 236, "green": 233, "blue": 167}, "key_2_in_row_2": {"red": 244, "green": 236, "blue": 161}, "key_2_in_row_3": {"red": 249, "green": 236, "blue": 156}, "key_2_in_row_4": {"red": 250, "green": 235, "blue": 155}, "key_3_in_row_1": {"red": 233, "green": 233, "blue": 170}, "key_3_in_row_2": {"red": 241, "green": 235, "blue": 162}, "key_3_in_row_3": {"red": 247, "green": 236, "blue": 157}, "key_3_in_row_4": {"red": 250, "green": 236, "blue": 155}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 231, "green": 232, "blue": 172}, "key_1_in_row_2": {"red": 239, "green": 234, "blue": 164}, "key_1_in_row_3": {"red": 246, "green": 236, "blue": 159}, "key_1_in_row_4": {"red": 250, "green": 236, "blue": 155}, "key_2_in_row_1": {"red": 229, "green": 230, "blue": 175}, "key_2_in_row_2": {"red": 237, "green": 234, "blue": 166}, "key_2_in_row_3": {"red": 244, "green": 236, "blue": 160}, "key_2_in_row_4": {"red": 249, "green": 236, "blue": 156}, "key_3_in_row_1": {"red": 226, "green": 229, "blue": 177}, "key_3_in_row_2": {"red": 234, "green": 233, "blue": 168}, "key_3_in_row_3": {"red": 242, "green": 235, "blue": 162}, "key_3_in_row_4": {"red": 248, "green": 236, "blue": 157}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 223, "green": 227, "blue": 180}, "key_1_in_row_2": {"red": 232, "green": 232, "blue": 170}, "key_1_in_row_3": {"red": 240, "green": 235, "blue": 164}, "key_1_in_row_4": {"red": 247, "green": 236, "blue": 158}, "key_2_in_row_1": {"red": 220, "green": 226, "blue": 182}, "key_2_in_row_2": {"red": 229, "green": 231, "blue": 173}, "key_2_in_row_3": {"red": 237, "green": 234, "blue": 166}, "key_2_in_row_4": {"red": 245, "green": 236, "blue": 160}, "key_3_in_row_1": {"red": 217, "green": 225, "blue": 185}, "key_3_in_row_2": {"red": 227, "green": 230, "blue": 176}, "key_3_in_row_3": {"red": 235, "green": 233, "blue": 169}, "key_3_in_row_4": {"red": 243, "green": 235, "blue": 161}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 215, "green": 224, "blue": 187}, "key_1_in_row_2": {"red": 224, "green": 228, "blue": 179}, "key_1_in_row_3": {"red": 233, "green": 232, "blue": 171}, "key_1_in_row_4": {"red": 241, "green": 235, "blue": 163}, "key_2_in_row_1": {"red": 212, "green": 223, "blue": 190}, "key_2_in_row_2": {"red": 221, "green": 227, "blue": 182}, "key_2_in_row_3": {"red": 230, "green": 231, "blue": 173}, "key_2_in_row_4": {"red": 238, "green": 235, "blue": 165}, "key_3_in_row_1": {"red": 209, "green": 221, "blue": 193}, "key_3_in_row_2": {"red": 219, "green": 225, "blue": 184}, "key_3_in_row_3": {"red": 228, "green": 230, "blue": 175}, "key_3_in_row_4": {"red": 236, "green": 233, "blue": 167}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 206, "green": 220, "blue": 195}, "key_1_in_row_2": {"red": 216, "green": 224, "blue": 187}, "key_1_in_row_3": {"red": 225, "green": 229, "blue": 178}, "key_1_in_row_4": {"red": 234, "green": 233, "blue": 169}, "key_2_in_row_1": {"red": 203, "green": 219, "blue": 197}, "key_2_in_row_2": {"red": 213, "green": 223, "blue": 189}, "key_2_in_row_3": {"red": 222, "green": 227, "blue": 181}, "key_2_in_row_4": {"red": 232, "green": 232, "blue": 172}, "key_3_in_row_1": {"red": 200, "green": 218, "blue": 199}, "key_3_in_row_2": {"red": 210, "green": 222, "blue": 192}, "key_3_in_row_3": {"red": 220, "green": 226, "blue": 183}, "key_3_in_row_4": {"red": 229, "green": 230, "blue": 175}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 197, "green": 217, "blue": 202}, "key_1_in_row_2": {"red": 207, "green": 220, "blue": 194}, "key_1_in_row_3": {"red": 216, "green": 224, "blue": 186}, "key_1_in_row_4": {"red": 226, "green": 229, "blue": 177}, "key_2_in_row_1": {"red": 194, "green": 216, "blue": 204}, "key_2_in_row_2": {"red": 204, "green": 219, "blue": 196}, "key_2_in_row_3": {"red": 214, "green": 223, "blue": 188}, "key_2_in_row_4": {"red": 224, "green": 227, "blue": 179}, "key_3_in_row_1": {"red": 190, "green": 215, "blue": 206}, "key_3_in_row_2": {"red": 201, "green": 218, "blue": 199}, "key_3_in_row_3": {"red": 211, "green": 222, "blue": 191}, "key_3_in_row_4": {"red": 221, "green": 226, "blue": 182}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 187, "green": 214, "blue": 208}, "key_1_in_row_2": {"red": 198, "green": 217, "blue": 201}, "key_1_in_row_3": {"red": 208, "green": 221, "blue": 193}, "key_1_in_row_4": {"red": 218, "green": 225, "blue": 185}, "key_2_in_row_1": {"red": 183, "green": 212, "blue": 209}, "key_2_in_row_2": {"red": 195, "green": 216, "blue": 203}, "key_2_in_row_3": {"red": 205, "green": 220, "blue": 196}, "key_2_in_row_4": {"red": 215, "green": 224, "blue": 187}, "key_3_in_row_1": {"red": 180, "green": 211, "blue": 211}, "key_3_in_row_2": {"red": 192, "green": 215, "blue": 205}, "key_3_in_row_3": {"red": 202, "green": 219, "blue": 198}, "key_3_in_row_4": {"red": 212, "green": 223, "blue": 190}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 177, "green": 210, "blue": 213}, "key_1_in_row_2": {"red": 189, "green": 214, "blue": 207}, "key_1_in_row_3": {"red": 199, "green": 217, "blue": 200}, "key_1_in_row_4": {"red": 209, "green": 221, "blue": 192}, "key_2_in_row_1": {"red": 173, "green": 209, "blue": 214}, "key_2_in_row_2": {"red": 185, "green": 213, "blue": 209}, "key_2_in_row_3": {"red": 196, "green": 216, "blue": 203}, "key_2_in_row_4": {"red": 206, "green": 220, "blue": 194}, "key_3_in_row_1": {"red": 168, "green": 208, "blue": 216}, "key_3_in_row_2": {"red": 182, "green": 212, "blue": 210}, "key_3_in_row_3": {"red": 193, "green": 215, "blue": 204}, "key_3_in_row_4": {"red": 203, "green": 220, "blue": 196}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 165, "green": 206, "blue": 219}, "key_1_in_row_2": {"red": 178, "green": 210, "blue": 212}, "key_1_in_row_3": {"red": 189, "green": 214, "blue": 206}, "key_1_in_row_4": {"red": 200, "green": 218, "blue": 199}, "key_2_in_row_1": {"red": 160, "green": 204, "blue": 221}, "key_2_in_row_2": {"red": 174, "green": 209, "blue": 214}, "key_2_in_row_3": {"red": 186, "green": 213, "blue": 208}, "key_2_in_row_4": {"red": 197, "green": 217, "blue": 201}, "key_3_in_row_1": {"red": 156, "green": 203, "blue": 222}, "key_3_in_row_2": {"red": 170, "green": 208, "blue": 215}, "key_3_in_row_3": {"red": 183, "green": 212, "blue": 210}, "key_3_in_row_4": {"red": 194, "green": 216, "blue": 204}}, "sleep": 100}, {"keys": {"key_1_in_row_1": {"red": 151, "green": 202, "blue": 224}, "key_1_in_row_2": {"red": 166, "green": 207, "blue": 217}, "key_1_in_row_3": {"red": 179, "green": 211, "blue": 212}, "key_1_in_row_4": {"red": 191, "green": 215, "blue": 205}, "key_2_in_row_1": {"red": 147, "green": 201, "blue": 226}, "key_2_in_row_2": {"red": 162, "green": 205, "blue": 220}, "key_2_in_row_3": {"red": 176, "green": 210, "blue": 214}, "key_2_in_row_4": {"red": 188, "green": 214, "blue": 207}, "key_3_in_row_1": {"red": 144, "green": 200, "blue": 228}, "key_3_in_row_2": {"red": 158, "green": 203, "blue": 222}, "key_3_in_row_3": {"red": 172, "green": 208, "blue": 215}, "key_3_in_row_4": {"red": 185, "green": 213, "blue": 209}}, "sleep": 100}]

Customize animation speed

You can use the parameter --show-frame-for-ms <number> to customize the animation playback speed. --show-frame-for-ms takes one argument which is the number of milliseconds each frame should be visible for. --show-frame-for-ms 1000 would make each frame be visible for 1 full second for example. You can use the flag like this:

$ python3 ./image2kiwi --show-frame-for-ms 1000 ~/Desktop/image1.jpg ~/Desktop/image2.jpg ~/Desktop/image3.jpg

Notice

  • image2kiwi converts GIFs into multiple frames, meaning that you'd end up with a constantly moving Kiwi animation!
  • image2kiwi converts RGBA into RGB - you can use transparent PNGs, but obviously the transparent parts won't make your keys transparent :-)
  • image2kiwi scales images down to a maximum of 3x4px while keeping their aspect ratio. This means: If you supply a 300x300px image, you will end up with a 3x3px animation. In that case the bottom keys row won't be triggered by the animation at all. You need to supply an image that's 3x4px or has an aspect ratio of 3:4.

"Let me tell you..."

Sure, tell me!