imagefont.bin tool for PS3 and Vita

Are good :)
Btw, they uses originally indexed colors in the PS4 firmware, or are you converting them to indexed colors manually ?
I am converting manually with TinyPNG site. PS4 emojis are not indexed normally, (they're from rco on ps4). As far as I know there is no imagefont.bin on PS4.
 
Overall all them looks better, if we look at some of them individually there could be some that are a bit "meh", and with this i mean that the original icon from PS3 firmware looks a bit better as a first impression, like this smyleis, the originals have like a "bump" effect, and the others from PS4 doesnt have that "bump", so someone could say " meh"... but that "bump" effect is another "meh"
Are small details of individual icons... but is obvious they represents the same in PS3 firmware and PS4 firmware so is a pack

Is good because the goal is well defined. Is needed to complete that pack + the dualshock icons i made (that in my humble oppinion are better than the originals in PS4)
At first we wanted to reserve a lot of slots for other custom icons, and that plan failed, ooops, but your idea is about to be completed :)

We have a problem with the animated icons (because the shared indexed color palette), if you find that images store them until we find the way to convert them
I should take another look at what @littlebalup was doing, he made an animated icon from scrach (of a green dwarf, or a chicken \o/) by painting pixels lot of time ago and the tool was compiling it fine with the custom frames and custom animation
 
Yeah, some of them could be better alright. But I can only do so much. I do want to add custom icons too. But figuring out the placement of those could be a project in itself.

I added a few in this latest one, They can be moved/removed if need be. all resized to 36 high.
upload_2019-11-7_21-16-29.png


Now there are just a few left to do. These 18 animated icons:
upload_2019-11-7_21-18-23.png


And these 17 system icons.
upload_2019-11-7_21-20-52.png



So just 35 left. Shall we bother do those? I dont think I can do those ones but shame when we are so close.. Also Death Stranding is out in 2.5 hours so I might be MIA for a while.. :)
 
Last edited:
We could replace the animated icons with static icons from PS4...there are suitable replacement for most of them,

upload_2019-11-7_22-21-0.png
 
Last edited:
We could replace the animated icons with static icons from PS4...there are suitable replacement for most of them,

View attachment 21030
I guess is a matter of doing it, or dont do it, there is no medium term

There could be several arguments in both directions, but in this case i would do it because it follows your idea
The goal is to update all them with newer icons taken from PSVita or PS4... if they decided to make some of that updated versions static... well... is ok
 
I really don't want to go to static as it seems like too much of a downgrade. I think I might try to use the PS4 ones as a source to make the frames. That way they can be animated but also in same style. I am not sure if a am able though. :)

For example, we could replace the smiley animation:
upload_2019-11-11_16-37-9.png


With these as 4 frames.
upload_2019-11-11_16-35-47.png


This:
upload_2019-11-11_17-0-55.png


With:
upload_2019-11-11_17-1-57.png


This:
upload_2019-11-11_17-9-16.png


With:
upload_2019-11-11_17-9-52.png


Now even though those last ones are a mirror image, So EXACT SAME COLOURS. After indexing it using TinyPNG it has a different pallete and throws an error when I try to repack.

upload_2019-11-11_17-4-18.png


@littlebalup How did you do that little link animation and keep the same pallet for all frames? Any tips?
 

Attachments

Last edited:
@littlebalup How did you do that little link animation and keep the same pallet for all frames? Any tips?
I did it manually based on an annimated gif file. Animated gif share the same palette for all frames but it doesn't support semi-transparency. So it's not a perfect solution.
I don't have a solution actually.
 
Thanks, is a little tricky then. At the moment I cant even mirror image an emoji and keep same palette (after indexing again). I can rotate with windows as that does not effect the palette.

@Berion would you know how to force a series of images to use same palette? See my post above.
 
Last edited:
Such option is in Optpix Image Studio for PlayStation, but I didn't use it for ages and don't have it. Well, that's proprietary extremely overpriced software; unfortunately I don't know anything free/opensrc as such feature is mostly wanted by game developers, on top of that, rather in ancient times (because today saving space is no longer necessary, also no one today "securing" (prevention from modders) resources in such way).

Well, if the image is 8bit max, You can force it to use the same pallet just replacing the tables (if all sequenced images have very similar palettes, then after such changes will not be well visible). But this would be a pain the ass. ;p Easiest to do it could be a non compressed (no RLE, no LZ etc.), indexed BMP.

Animated gif share the same palette for all frames but it doesn't support semi-transparency.

As I remember, APNG supports also alpha in 8bit images (but I'm not sure if they share the same palette).
 
Last edited:
Does anyone here know how I would go about hex editing the palette on a bunch of frames to make them the same? Sometimes the differences are so small that its probably not going to matter. I had a look in HEX but cant see anything that looks like it might be it, Not that I would know if i saw it. :)

I was thinking if I took the palette from the middle frame 004, and copied it to the others that it might look ok?
 

Attachments

  • U+F46E_frame001.png
    U+F46E_frame001.png
    607 bytes · Views: 30
  • U+F46E_frame002.png
    U+F46E_frame002.png
    1.1 KB · Views: 30
  • U+F46E_frame003.png
    U+F46E_frame003.png
    1.4 KB · Views: 33
  • U+F46E_frame004.png
    U+F46E_frame004.png
    2.4 KB · Views: 31
  • U+F46E_frame005.png
    U+F46E_frame005.png
    2.4 KB · Views: 28
  • U+F46E_frame006.png
    U+F46E_frame006.png
    3.7 KB · Views: 32
  • U+F46E_frame007.png
    U+F46E_frame007.png
    3.7 KB · Views: 35
Last edited:
Does anyone here know how I would go about hex editing the palette on a bunch of frames to make them the same? Sometimes the differences are so small that its probably not going to matter. I had a look in HEX but cant see anything that looks like it might be it, Not that I would know if i saw it. :)

I was thinking if I took the palette from the middle frame 004, and copied it to the others that it might look ok?
In irfanview there is an option to export/import the palette, it works with png
The palette file uses a format that is some kind of standard... anyway it can be opened in notepad to check his contents because is text, so you could do...
1) extract palette1 from image1.png
2) extract palette2 from image2.png
3) compare them in notepad++ (with the compare plugin) to see how much they differs
4) import palette2 into image1.png
5) extract the palette again from image1.png just to check everything is ok as you intended

I remember i tryed this and was working, but as far i remember the result was bad visually

The root of the problem is the image info only stores an ID of the palette, lets say the pixels around an eye could be ID=40
If you change the color stored in ID=40 in the palette that few pixels are going to change his color... if the new color is close to the old color then the result will be aceptable, but if the colors are very different it will look very bad
 
Hmmm, i think i found a way that is exactly what we need... is just i dont know how to use this info, lulz, so i will just post some links

For this images needed by imagefont.bin i like to use PNGoo (the noob friendly interface of pngquant) because it does it pretty well
PNGoo is limited just because is intended to be simple, but i imagined the pngquant that runs behind it is able to do a lot more things :)
https://pngquant.org/

Basically, the problem we have is PNGoo can convert groups of PNG files... but it generates a different color palette for everyone of them... and that sucks for the animated icons of imagefont.bin (this is the problem we need to solve)

So... i was searching in google how to pass an argument to the command line indicating the palette that needs to be used (the same palette for multiple images), and i fond this:
https://github.com/kornelski/pngquant/issues/194
And this
https://pngquant.org/lib/#liq_image_add_fixed_color

Multiple images with the same palette

It's possible to efficiently generate a single palette that is optimal for multiple images, e.g. for an APNG animation. This is done by collecting statistics of images in a liq_histogram object.

Code:
liq_attr *attr = liq_attr_create();
liq_histogram *hist = liq_histogram_create(attr);

liq_image *image1 = liq_image_create_rgba(attr, example_bitmap_rgba1, width, height, 0);
liq_histogram_add_image(hist, attr, image1);

liq_image *image2 = liq_image_create_rgba(attr, example_bitmap_rgba2, width, height, 0);
liq_histogram_add_image(hist, attr, image2);

liq_result *result;
liq_error err = liq_histogram_quantize(attr, hist, &result);
if (LIQ_OK == err) {
    // result will contain shared palette best for both image1 and image2
}

Whatever that means... thats our solution and it should work pretty fine (the only pita is we cant use PNGoo for this kind of conversion :/ i guess needs to be passed as arguments in command line to pngquant)

Anyway... im not even sure if pngquant allows to pass this options as arguments... i have not spent much time reading at that link but are just a few functions (from some point of the source code i ignore)
Anyway... the point is it seems pngquant is able to do exactly what we need :)

----------
Btw, pngquant is open source, have you took a look at it @littlebalup ?, maybe there is some easy way to integrate it in your toolkit
 
IT WORKS ! (and it does it very accuratelly, hehehe, the palettes generated for multiple files are identical), im going to make this post short, like a tutorial

1) Download pngquant.exe (command line tool) for --->x64 or --->x86

2) One of the images is going to be used as a "mapfile" by using the "--map" argument... it works but the help info doesnt mentions (is hidden , heeheh). That mapfile needs to be a PNG with indexed colors

3 ) Run this command:
Code:
C:\pngquant.exe --map "mapfile.png" "frame_1.png" "frame_2.png"

Pngquant wil generate 2 images named: "frame_1-fs8.png" and "frame_2-fs8.png" with identical palettes :) (you can verify it by extracting the palettes with irfanview and comparing them)
 
Look at this, for curiosity sake, im not going to show the images i used for the tests because are random images i had in the desktop, but i can show you the palettes where it can be seen well how it works :)
QMu7YUh.png

The palette at left is from the "mapfile.png" i used... it was an image at high resolution made in white and black, where i painted a bit on top with red and brown
The others are "frame_1-fs8.png" and "frame_2-fs8.png"

As you can see pngquant took the colors from the indexed palette of mapfile.png... then reordered the colors... and used them for the others images

The reordering of colors is something we dont need (but it doesnt disturbs either)... lets say... pngquant doesnt respects the positions of the colors in the palette, but is ok, we dont care
The good thing is the color seems to be preserved... and the palettes of the output files are identical, thats the feature we was looking for :)
 
it support apng already a small apng... I didn't gave enough memory to the picture viewer. https://upload.wikimedia.org/wikipedia/commons/1/14/Animated_PNG_example_bouncing_beach_ball.png
The bouncing ball is small enough to be isplayed properly ;)

Later, I'll try to add gim, dds and bmp... and maybe more with Imagemagick if I find a way to get raw pixels as ARGB...
APNG is already supported ?, cool even if is in small size by now, is a nice feature, eventually could be used for some eyecandy in the interface :)

The gif support could be made "throught" APNG, by including the pngquant plugin into imagemagic or the pngquant library
The link i posted to the library documentation mentions that to do this accuratelly first is needed to run some functions to make an analisys of the palettes of all the frames... from that it generates a single palette intended to be used in all frames

Thats different of what i did in the command i posted before... im just taking the palette from a single image, heheh, it works good enought though, but is just a first approach
Incase of doing it well it should work pretty fine to convert GIF to APNG automatically

Maybe is a bit excesive to add this GIF2APNG conversion to ManaGunZ though... is not a real GIF support but mostly like a wayaround
 
Hmmm, im writing too much today, but im in a strike... time ago i thought in a trick to generate an accurate color palette that could be applyed to all the frames of an animation
I guess it can be used together with the pngquant command line argument "--map" i explained before

The idea is... if the source images are already indexed you need to convert them to RGB (in other words, remove the indexed palette)
We dont want to deal with that palettes because are an annoyance, the best thing we can do with them is to delete them
After that we need to generate a good color palette for all the frames... there are many image editors that can do that... but the real problem is that palette needs to be generated at a point where all the frames are visibles in the program

Lets say... if a frame is 20x20 pixels and you need to create a palette for 20 frames then you need to display the 20 frames together
If you open one of the images in photoshop/gimp, and start dropping other frames in it... the canvas size is going to be always 20x20 (because the newest layers covers the old layers), and when you generate the palette is going to contain only the colors of the pixels at the top layer (im striking this text to dont confuse you... is just an example of something that doesnt works... dont do it this way)

The correct way to do it with an image editor program... following the example of an animation composed by 20 frames of 20x20 pixels each... what we need to do is start creating an empty image of 400x20 pixels, and paste the frames in it next to each others... like in a old film tape
The goal is... we need the 100% of the pixels of all the frames visibles together in the same layer, and without overlappings
And at that point is when you can convert the image to "indexed colors" (with 256 colors), and save it as mapfile.png

After that you can use the command
Code:
C:\pngquant.exe --map "mapfile.png" "frame_1.png" "frame_2.png" "frame_3.png" "frame_4.png" (...and so on up to the 20 frames of the animation)
 
Last edited:
Back
Top