Page 1 of 1

[Solved] Converting a PNG file into a X-Face file

Posted: Mon Nov 28, 2022 7:24 pm
by vatolin
I have converted a PNG file into a X-Face file. So, I have opened the respective PNG file in GC. Then I ran File > Save as ... > X-Face (*.X-FACE). I have got a file with suffix .xfg.

Then I have the same file converted by using a web based converter: http://www.dairiki.org/xface/xface.php. I have got a string of ASCII code.

But, and this is what I am being wondering about, the ASCII content of the .xfg file made by GC differs from the code of the web based converter. And at the end the X-Face pictures rendered by e.g. Hogwasher.app differ as well.

Why do different converters deliver different results, allthough both convert the same origin file into the same target format?

Re: Converting a PNG file into a X-Face file

Posted: Mon Nov 28, 2022 7:48 pm
by forum_adm
A X-Face file has a pixel size of 48 x 48 pixels with only black and white pixels. So, the file will be different depending on the used scaling and dithering method.

You will get exact the same results if you start with a PNG with only 48 x 48 pixels with only black and white.

Re: Converting a PNG file into a X-Face file

Posted: Mon Nov 28, 2022 8:07 pm
by vatolin
forum_adm wrote: Mon Nov 28, 2022 7:48 pm You will get exact the same results if you start with a PNG with only 48 x 48 pixels with only black and white.
So I assume, I 've got different result because the original file had certainly 48 x 48 pixels but it was an 8 bit greyscale image, that had must being rendered. Right?

Re: Converting a PNG file into a X-Face file

Posted: Tue Nov 29, 2022 6:20 am
by forum_adm
Yes, correct.

Just use i.e. the Floyd Steinberg command in GraphicConverter onto your image and resave as PNG.
Now all apps should deliver the same result:
Screenshot 2022-11-29 at 06.20.21.jpg
Screenshot 2022-11-29 at 06.20.21.jpg (74.9 KiB) Viewed 1473 times