Lossy compression for NES screens
Moderator: Moderators
Re: Lossy compression for NES screens
Edit: post removed due to dead links.
Last edited by JRoatch on Sun Feb 12, 2023 1:02 pm, edited 1 time in total.
Re: Lossy compression for NES screens
In case the original Tweet disappears, the drawing is mirrored on Danbooru at https://danbooru.donmai.us/posts/2178017
illustrator: Kiyohiko AZUMA
series: Yotsuba&!
characters: Yotsuba KOIWAI and her teddy bear Duralumin
Mirror's translation of caption:
EDIT: I missed something. Clarify purpose of this post in light of this.
illustrator: Kiyohiko AZUMA
series: Yotsuba&!
characters: Yotsuba KOIWAI and her teddy bear Duralumin
Mirror's translation of caption:
Yesterday's daily calendar image is "A pair of slime sisters who mimic another party's form and appeal to friendship, Youtsuba somehow figuring it out, and Duralumin not understanding a thing."
EDIT: I missed something. Clarify purpose of this post in light of this.
Re: Lossy compression for NES screens
The first post in this thread already contains a link to the source, and it's the artist's Twitter account instead of a reupload on an image gallery...
Re: Lossy compression for NES screens
Oops, my fault. I misread something. Clarified.
Re: Lossy compression for NES screens
A much improved rewrite of this tool which is orders of magnitude faster, slightly better looking, and can handle tile flips, can be found at the attachment in the next post.
Edit: removed dead links.
Edit: removed dead links.
Last edited by JRoatch on Sun Feb 12, 2023 1:01 pm, edited 1 time in total.
Re: Lossy compression for NES screens
Congratulations on shipping! Calling for backup
- Attachments
-
- jrrtilevq_2020-12-07.zip
- (87.65 KiB) Downloaded 202 times
Re: Lossy compression for NES screens
It was pointed out that the 2020-12-07 version of this was causing segmentation faults with large (about 49000 tiles) images.
The patch for this is to change the variable types and change the if statement for jrrtilevq_distance_matrix_coords as follows:
Even with this patch, the input image size is still limited to <65536 tiles.
The real fix would be to replace the stupidly large square array with an actual priority queue.
The patch for this is to change the variable types and change the if statement for jrrtilevq_distance_matrix_coords as follows:
Code: Select all
static uint32_t jrrtilevq_distance_matrix_coords(uint32_t x, uint32_t y, uint32_t w)
{
assert(x != y);
if (y < x) {
uint32_t temp = x;
x = y;
y = temp;
}
y = w - y - 1;
uint32_t r = y * w + x;
if ((w * (w-1)) / 2 <= r) {
r = (w * (w-1)) - r - 1;
}
return r;
}
The real fix would be to replace the stupidly large square array with an actual priority queue.