In comp.misc, Eli the Bearded <*@eli.users.panix.com> wrote:
Pixel Studio, available for at least Android and Iphones, and possibly
other platforms, has a native save format, called PSP (Pixel Studio
Project, most likely). I'd really like a way to turn PSP files into
something else, something standard, PNG, GIF, etc, from command line.
The format is JSON based, but the images seem to be encoded as the incremental steps to produce the output, rather than a final image.
I found a solution, of sorts. I still can't convert a Pixel Studio .psp
file into a PNG, GIF, etc, but I discovered that Pixel Studio has a
secret automatic conversion.
In order to get the preview in the file open command, the app uses a
JSON encoded "Gallery.cache" file. To grab the image "evil-flower.psp"
from the cache I can do this:
< "$HOME/storage/shared/DCIM/Pixel Studio/Gallery.cache" \
jq -c '.[] | {(.Path|sub(".*/";"")): .Texture }' |
grep '"evil-flower.psp": |
jp -r '.[]' |
base64 -d > evil-flower.png
I have a helper script to do that here:
https://qaz.wtf/netpbm/psp-preview
Since the cache above is the default location (it's where I have it),
the equivilent command line to the above would be:
psp-preview -p evil-flower.psp > evil-flower.png
Some things I learned along the way:
* the base64d built into jq is kinda useless. jq is not binary
safe, and expects everything to be UTF-8. PNG files are not
readable as UTF-8 files.
* this killed my original plan to extract all psp files from
the cache within a jq script
* the obvious ways to grep for a matching string within jq
itself return true or false instead of the matching lines,
so I gave up trying to get that to work and broke out grep
Elijah
------
expecting not many people will find this useful but still
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)