gfcwfzkm / pif-image-format Goto Github PK
View Code? Open in Web Editor NEWImage format, tools & librares for limited embedded systems
License: GNU Lesser General Public License v2.1
Image format, tools & librares for limited embedded systems
License: GNU Lesser General Public License v2.1
FYI, support for parsing PIF was added to Kaitai Struct a little while ago, see:
https://github.com/kaitai-io/kaitai_struct_formats/blob/master/image/pif.ksy
There is a link to PIFtestENV/README.md
in C Library/examples/README.md
:
but the C Library/examples/PIFtestENV/
directory has no README.md
.
I suspect it should be the number of bytes, since the "important" resources seem to prefer this semantics, but it's not 100% clear because some files quite explicitly suggest otherwise:
ColorTableSize
is 32, which matches the number of bytes)PIF-Image-Format/Image Converter/PIFGUI.py
Lines 772 to 779 in 74775a6
PIF-Image-Format/Image Viewer/PIF Viewer/Viewer.cs
Lines 123 to 137 in b0cee7f
Specification/PIF Format Specification.pdf
Color Table Size: Index size of the color table, only used in Indexed mode, otherwise zero.
To me, "index size" suggests the number of entries, not bytes. I understand "index size" as the size of the index set, i.e. "the maximum color table index that a pixel can refer to" plus 1 (because indices are from 0 to the number of color table entries minus one).
PIF-Image-Format/C Library/pifdec.h
Line 68 in 74775a6
typedef struct {
// ...
uint16_t colTableSize; // Color Table Size in Entries
// ...
}pifINFO_t;
I know that just because there's some field in pifINFO_t
doesn't mean the actual file format uses the same semantics (for example see imageType
, which has different values in pifINFO_t
than the file format uses). But in this case, colTableSize
is copied verbatim from the input .pif file without any conversion:
PIF-Image-Format/C Library/pifdec.c
Line 359 in 74775a6
And later in the code it's indeed treated as a number of entries (so it's not a lying code comment):
PIF-Image-Format/C Library/pifdec.c
Lines 421 to 425 in 74775a6
I'm working on a project where I want to have a server component (python) that ships images to a embedded LCD system (based around a ESP32).
Currently, I'm just using raw bitmaps, but this project looks like it'd be pretty handy. On the other hand, the current code for generating PIF images only seems to live in the converter GUI file.
This seems like the kind of thing that should be extracted out to a proper library, and be available somewhere like PyPi. Or at minimum in a separate file so it can be somewhat easily vendored.
I'd be happy to handle setting all that up, if you're OK with that, but I don't want to just jump in and start pushing stuff to PyPi without at least talking first.
The PDF of the specification seems to suggest that the file signature is "PIL" but the test files use "PIF".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.