![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/42638/JL Logo.png)
Sounds like you're thinking that I'm accusing you of being mistaken in your findings, that's definitely not the case. It's just that in your initial post you said the error appeared to stem from a lack of image complexity in a compressed, mostly single-color splash screen, and that adding a bit of visual complexity seemed to solve the issue. As I'm intending to use PX9 for compressing and storing relatively dense spritesheets, it doesn't seem like the issue should crop up. I'll try and adapt the new version for string capability just in case, though.
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/42224/2_wcb.jpg)
@JadeLombax, sorry no not at all. The new post is entirely new train of thought. I realize it was worded poorly. Disregarding entropy issues, I am seeing an effect where a properly compressed image seems to improperly decompress using the same string in the same cart just a few lines later, but if I save the string to a file and copy it into another cart, it works fine. I am asking a new question, if this weird behavior makes any sense to you, or despite thinking I was being thorough, I have some mistake in my test that I'm not seeing. Again I'm not challenging anything, just that you implemented/use the str version, and I'm seeing this weird behavior with the string version, so I reached out for your opinion/crosscheck.
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/42638/JL Logo.png)
Okay, I think I might know what the problem is. The string encoder outputs full 8-bit strings, which include 'puny font mode' characters, and unfortunately you have to press ctrl+p to enter puny font mode' before pasting them or they'll incorrectly show up as normal letters. Have you been doing that?
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/42224/2_wcb.jpg)
@JadeLombax I just wasn't thinking straight. PX9_COMP returns a string with escaped characters, which have to be pasted into the code as a literal in order for them to be processed correctly. I was taking the string result from PX9_COMP, as a live variable in running code, and directly shoving it back into PX9_DECOMP, and was confused by the garbled output.
<<< entire page of crap deleted that doesn't matter anymore >>>
Here is a demo cart fwiw:
Sorry for going down a rabbit-hole for a useless use-case side effect and adding pages to the BBS thread.
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/42638/JL Logo.png)
Well, it's not useless if it helps someone else avoid a similar problem in the future.🙂
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](https://www.lexaloffle.com/bbs/files/15232/me-square.jpg)
![](/gfx/play80.png)
![](/bbs/thumbs/pico8_pejamomimo-0.png)
Here now, this is not good. I tried Px9 to compress some test pictures to see how it would do and BOY did it fail on one of them !
Also these are findings AFTER I wrote my own compressor, mind you, not before. I just wanted to try out @zep's brainchild and compare it with the one I wrote.
The import is standard, 128x128 single color, font I doodled up along with ZEP's own characters >128 and <32.
I can post mine which does work but I really don't wanna do that cause this is ZEP's post. I'd be more interested in seeing it work for Px9.
. . .
Update 12-19-22. It works in a version someone ELSE posted. So I guess I have to say, do not use the cart that is listed directly at the top as it has not been updated yet.
Further I have not found a version that saves to string AND still correctly decompresses my test image, so if there isn't one, that means I have written the only one.
And I would like that very much not to be the case as I want @zep to be able to own this.
...
Also, @freds72 replied to this comment, not in this thread, but this ONE:
https://www.lexaloffle.com/bbs/?tid=50713
Why did he ? I don't know. Yes that is confusing.
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/87548/arrow userpic2-4.gif)
Having an issue where a 128x64 image with only 3(4 if you count transparent black) colors compresses to the same size as a full-color 128x128 image. if it's all going to be the same size, could I put 2 128x64 images on one thing, compress it, then extract half the image somehow?
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/78171/14_Piconut-Icon.png)
If I wanted to export my spritesheet data to the map, so that I can read from map for extra sprite data when I boot up the game, how would I do that? Is there a way to copy or export the map data affected by the compression so I can put it in my game? PX9 doesn't do this by default, correct?
In other words, I'm unsure how PX9 works. I would like it to compress my spritesheet data to map data, but I'm unsure how to retrieve that map data so I can put it in my game.
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/95626/2016-03-20-22-56-48_avatar_small.jpg)
Thanks for this great tool. I used it to store a title screen image in my game: https://www.lexaloffle.com/bbs/?tid=143267
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](https://www.lexaloffle.com/bbs/files/14827/doba.png)
Question on the compressed data - does it always start and/or terminate with a specific sequence?
I would like to use px9 to store lots of small levels, so I will be storing them in sequence in cart memory. I can just keep track somewhere else in memory of all the start locations... But it would be cool if I could dynamically look at a long sequence of compressed data and detect how many compressed maps are in there. I could do that if each sequence starts or ends with a predictable byte.
How can I detect the start or end of data that has been compressed by px9? Is it possible?
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](https://www.lexaloffle.com/bbs/files/25532/icon.png)
that would mean scanning the whole sequence?
you'd better compress the maps, record length for each compressed bytes and store that table.
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](https://www.lexaloffle.com/bbs/files/14827/doba.png)
@freds72 yes, I am proposing scanning the whole sequence. My thought is I would do this once during _init and then create the table you propose.
I'm interested in this for when I am swapping the compressed data between carts. If I can scan the whole sequence, then I can just worry about copying the compressed data from cart to cart. However, if I cannot scan it and produce the table you suggest just from the data itself, then I also need to save the lengths, as you suggest.
It would just make the data-swapping from cart to cart easier if I can reconstitute the table from the data itself, rather than also having to save and transfer the length of each sequence.
Does this idea make sense? Is it possible?
[Please log in to post a comment]