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


Groups > comp.misc > #21229 > unrolled thread

wanted: someone to reverse engineer a file format

Started byEli the Bearded <*@eli.users.panix.com>
First post2021-08-08 04:58 +0000
Last post2021-08-28 21:30 +0000
Articles 4 — 2 participants

Back to article view | Back to comp.misc


Contents

  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

#21229 — wanted: someone to reverse engineer a file format

FromEli the Bearded <*@eli.users.panix.com>
Date2021-08-08 04:58 +0000
Subjectwanted: someone to reverse engineer a file format
Message-ID<eli$2108080035@qaz.wtf>
While this is a serious request, in the sense I seriously want this,
it's more of old man shouts at cloud than an expectation that I'll
get a response.

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.

The author of Pixel Studio has created an importer for Unity, but Unity
is a fancy GUI game development tool, not a command line thing. And
the importer is closed source, so I can't reuse the code. I put a
request in for a command line tool but it was turned down.

Anyway, if you know some kid who wants to reverse engineer a image
file format, I'll by willing to throw a few bucks in the tip jar.

Elijah
------
Pixel Studio is a tool well suited for hand drawing GIFs

[toc] | [next] | [standalone]


#21233

FromTheo <theom+news@chiark.greenend.org.uk>
Date2021-08-08 16:10 +0100
Message-ID<T5h*6Z-qy@news.chiark.greenend.org.uk>
In reply to#21229
Eli the Bearded <*@eli.users.panix.com> wrote:
> While this is a serious request, in the sense I seriously want this,
> it's more of old man shouts at cloud than an expectation that I'll
> get a response.

Why not put some sample images on the web somewhere so people can take a
look?  Perhaps with a corresponding screenshot or whatever so they know what
to expect?  A collection of simple images would help understand how the
forward works.

It might be the format looks similar to something else - eg if they reused
some library to generate them.

Theo

[toc] | [prev] | [next] | [standalone]


#21278

FromEli the Bearded <*@eli.users.panix.com>
Date2021-08-08 21:07 +0000
Message-ID<eli$2108081707@qaz.wtf>
In reply to#21233
In comp.misc, Theo  <theom+news@chiark.greenend.org.uk> wrote:
> Eli the Bearded <*@eli.users.panix.com> wrote:
> > While this is a serious request, in the sense I seriously want this,
> > it's more of old man shouts at cloud than an expectation that I'll
> > get a response.
> 
> Why not put some sample images on the web somewhere so people can take a
> look?  Perhaps with a corresponding screenshot or whatever so they know what
> to expect?  A collection of simple images would help understand how the
> forward works.

Sure, but it looks particular to that tool to me. Five examples, three
files created by me, two from others. The first one, a 4x4 image was one
I made to try to first understand the file format. It disabused me of
the idea that the _snapshot array would be an easy shortcut to getting
the image from the JSON.

https://qaz.wtf/tmp/pixelstudio/

It looks like it would be easy if it were all "Tool":0, but as the other
examples show, it's not. Tool 0 seems to correspond to drawing single
pixels. These examples have Tool 0, Tool 3 (circle maker?), and some
others I don't know:

  $ grep -ho "Tool[^,]*" *psp |sort |uniq -c | sort -nr
    68 Tool\":3
    31 Tool\":0
    22 Tool\":10
     9 Tool\":1
     6 Tool\":20
     5 Tool\":14
     2 Tool\":6
     2 Tool\":2
     2 Tool\":16

(The history is json embeded in json, so backslashes galore.)

https://qaz.wtf/tmp/pixelstudio/

Elijah
------
Dr Monocle is a long running character of mine, based on a Lego minifig

[toc] | [prev] | [next] | [standalone]


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

FromEli the Bearded <*@eli.users.panix.com>
Date2021-08-28 21:30 +0000
SubjectRe: wanted: someone to reverse engineer a file format [kinda solved]
Message-ID<eli$2108281730@qaz.wtf>
In reply to#21229
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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.misc


csiph-web