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

Having tech problems? Post them here and do not worry, there is always a solution for you.
Post Reply
vatolin
Posts: 2
Joined: Mon Nov 28, 2022 6:36 pm

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

Post 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?
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

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

Post 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.
vatolin
Posts: 2
Joined: Mon Nov 28, 2022 6:36 pm

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

Post 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?
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

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

Post 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 565 times
Post Reply