Published a Python library for basic PSP file-manipulation

Moderator: Kathy_9

Post Reply
crawford
Posts: 11
Joined: Mon Jun 27, 2016 2:42 pm
operating_system: Windows 7 Professional
System_Drive: C
32bit or 64bit: 64 Bit
ram: 4GB
Corel programs: PSP X7
Location: East coast USA

Published a Python library for basic PSP file-manipulation

Post by crawford »

If anyone's interested in playing alpha-tester for a PSP library :)

I recently finished a Python library I was working on, to manipulate/convert PSP files. It's currently in alpha, seems to work for me, but I'm sure there's bugs. Also has a fair number of constraints - for instance, you have to File->Save-As version X, since that's the last version I can find documentation on. Also, Layers have to be saved uncompressed, haven't yet implemented LZ77 decompression.

Its main function is format-conversion - for instance, taking a PSP file with a transparency-layer, and saving as a PNG file that has an Alpha channel with the transparency. It can be used either on the command line, or as a Python API - the API is more complex to use (and requires Python coding), but has more capabilities than the command-line.

Basic command-line usage would be something like:

Code: Select all

psp_scan some_file.pspimage -m 3  # output - somefile.png
That would convert the PSP file to a PNG (by default - BMP is also supported), with mask-layer 3 saved to the Alpha channel

It's published on PyPi, so it can be installed with pip:

https://pypi.python.org/pypi/psp-scan

Wiki page with install/usage documentation:

https://github.com/CrawfishPress/psp_scan/wiki

It requires that Pillow be installed. This isn't hard, but one minor issue I had on some versions of Windows, was installing zlib. (If that's a problem for people, I can change the package's version requirements to Pillow==2.9.0, which doesn't require zlib).

Note: this is a standalone Python library, not related to PSP's scripting.

Looking forward to the brutal feedback. (okay, not really, however any feedback is appreciated). :D

Comments/questions can be left here, or my email address in my profile.

John C>
Post Reply