Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.misc > #21417

Re: wanted: someone to reverse engineer a file format [kinda solved]

From Eli the Bearded <*@eli.users.panix.com>
Newsgroups comp.misc
Subject Re: wanted: someone to reverse engineer a file format [kinda solved]
Date 2021-08-28 21:30 +0000
Organization Some absurd concept
Message-ID <eli$2108281730@qaz.wtf> (permalink)
References <eli$2108080035@qaz.wtf>

Show all headers | View raw


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

Back to comp.misc | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

wanted: someone to reverse engineer a file format Eli the Bearded <*@eli.users.panix.com> - 2021-08-08 04:58 +0000
  Re: wanted: someone to reverse engineer a file format Theo <theom+news@chiark.greenend.org.uk> - 2021-08-08 16:10 +0100
    Re: wanted: someone to reverse engineer a file format Eli the Bearded <*@eli.users.panix.com> - 2021-08-08 21:07 +0000
  Re: wanted: someone to reverse engineer a file format [kinda solved] Eli the Bearded <*@eli.users.panix.com> - 2021-08-28 21:30 +0000

csiph-web