Closed michaelshmitty closed 1 year ago
Awesome! Thanks! I was busy implementing the color cycling part, including how to edit them in the color palette so this is a perfect combo. Thanks again. GREATLY appreciated!
Wheeh! Look at those cycles going ! :-)
https://github.com/steffest/DPaint-js/assets/763047/4d518a28-011d-4373-b9a2-e13786b63e92
Wheeh! Look at those cycles going ! :-) 2023-06-05.09-57-51.mp4
Ooooh nice!
Hi Stef!
This includes some code that fixes loading PBM image type files. I tried to isolate the code as much as possible so you can decide how much of it you want to use / merge.
Like ILBM, PBM files use the IFF format but have the
PBM
FORM chunk identifier instead ofILBM
. (Note the space inPBM
as the FORM chunk identifiers seem to adhere to a standard length of 4 bytes.)From what I can tell PBM is used by the PC version of Deluxe Paint because the hardware did not support some of the more advanced ILBM features. I ran into this problem when trying to load some of Mark Ferrari (of LucasFilm fame)'s original artwork.
Compressed PBM before the fix
Compressed example after the fix
Uncompressed example before the fix
Uncompressed example after the fix
I can get you the original files for testing if you want. I don't want to post them here.
In order to better understand and attempt to fix the problem I made an isolated PBM-js library that only parses PBM files. It also supports color cycling, albeit not in a very optimal way.
Note about linting I've added ESLint as a dev dependency to the project and applied it to the files I've worked on in this PR. Some informational
console.log
statements got removed as well as some unused variables. Whitespace got adjusted as well. I did override the default of 2 spaces tabs to 4 spaces tabs to honor that convention in this project. The linter also reported an error here: https://github.com/steffest/DPaint-js/blob/master/_script/fileformats/iff.js#L276AdfViewer
is undefined and I wasn't able to find any reference to it in the code.The linting stuff is in a completely separate commit so feel free to ignore that if you want!
Cheers and thanks for this awesome project! Michael