YesNoOk
avatar

PNG portrait with low quality (Read 9370 times)

Started by Muttley Creations, June 29, 2023, 02:13:09 pm
Share this topic:
PNG portrait with low quality
#1  June 29, 2023, 02:13:09 pm
  • **
    • Brazil
Hello friends. I'm reviving this thread to ask for a huge help. I've been making my games in Mugen and saving my portraits in PCX. However, I would like to use them in PNG. The saved image looks great in quality (I use multiple colors and effects). But inside the game the portrait is blurred and with loss of quality. Where would my mistake be?
Re: PNG portrait with low quality
#2  June 29, 2023, 03:26:35 pm
  • ****
  • Formerly DeathScythe
    • Brazil
    • lyricasky.neocities.org
If you're using 1.0:
You can use pcx and png, but the images MUST be indexed. Which means a total of 256 colors, including the transparent color. If your image has more than this, when you import it to the sff (via fighter factory for example), it will have color loss. To avoid that you can index your image using an image editor like Photoshop, wich makes it look slightly better, but still, you won't have the same quality as the original.
Plus, I remember 1.0 handles image with many colors a little weird. Check this topic to see what I mean.

If you're using 1.1:
You can use 24bit png if you have the renderer set as OpenGL, which means no indexing is needed, which means no color loss! But you have to save the sff as 1.1 / v2.1.
Check this topic to know more.

Hopefully my explanation was useful. :)
Last Edit: June 29, 2023, 03:30:16 pm by DeathScythe
Re: PNG portrait with low quality
#3  June 29, 2023, 08:39:28 pm
  • **
    • Brazil
Thank you for the informations. The problem happens for both Mugen 1.1 and Ikemen Go.
I had done the portrait art in 32bit. But I will change to 16bits. Everything is as you mentioned, but it still loses quality!
Re: PNG portrait with low quality
#4  June 29, 2023, 09:20:50 pm
  • **
    • Brazil

Portrait made in Photoshop, saved as 32-bit png


Portrait inside Ikemen Go, with loss of sharpness and quality


Replacement of portrait in FF
Re: PNG portrait with low quality
#5  June 29, 2023, 09:59:19 pm
  • ****
  • Formerly DeathScythe
    • Brazil
    • lyricasky.neocities.org
So the sprite looks good in FF too, is not a problem with indexing. Are you resizing the image by any chance? In game, using scale or something...
Re: PNG portrait with low quality
#6  June 29, 2023, 11:12:25 pm
  • **
    • Brazil
because he is a friend, it is a good question.
I currently use the dimension in my chars: localcoord = 427,240

And in system.def:

p1.face.scale =  0.33,0.33
p2.face.scale =  0.33,0.33

Re: PNG portrait with low quality
#7  June 30, 2023, 12:15:36 am
  • avatar
  • **
    • USA
Ok. 

320 / 427 = 0.749~~ (less than 75%).  And then you are scaling it another 33%.  That is a gigantic amount of scaling.  So if the original resolution was 200px wide, it is now 49.461~~.  A very unclean number, and less than 25% of its original size.  So unless you are running Mugen in a resolution with a vertical of 1920px (2560x1920), you are going to lose a huge amount of quality.
Re: PNG portrait with low quality
#8  June 30, 2023, 12:25:48 am
  • **
    • Brazil
Ok. 

320 / 427 = 0.749~~ (less than 75%).  And then you are scaling it another 33%.  That is a gigantic amount of scaling.  So if the original resolution was 200px wide, it is now 49.461~~.  A very unclean number, and less than 25% of its original size.  So unless you are running Mugen in a resolution with a vertical of 1920px (2560x1920), you are going to lose a huge amount of quality.


I hadn't thought of that. It's a really big loss. I use my Mugen/Ikemen at 1280x720.
What values do you suggest?
Re: PNG portrait with low quality
#9  June 30, 2023, 11:37:42 am
  • **
    • Brazil
The idea of these values in leaving the characters with more harmonic dimensions and less pixelated.
Maybe the solution would be to make the illustration for the portrait a little bigger.  Maybe 2x the current value?
Re: PNG portrait with low quality
#10  June 30, 2023, 02:19:43 pm
  • ****
  • Formerly DeathScythe
    • Brazil
    • lyricasky.neocities.org
Making the portrait bigger and scaling it later will not make it look better. The ideal scenario would be not scaling it at all, make it 1:1.
Or, if you're working on a hires screenpack but lowres characters (screenpack uses localcoord = 640,480 and characters use 320,240), you can scale it to .5 and it will look good.
Re: PNG portrait with low quality
#11  July 01, 2023, 01:26:18 am
  • **
    • Brazil
Making the portrait bigger and scaling it later will not make it look better. The ideal scenario would be not scaling it at all, make it 1:1.
Or, if you're working on a hires screenpack but lowres characters (screenpack uses localcoord = 640,480 and characters use 320,240), you can scale it to .5 and it will look good.

Ok. 

320 / 427 = 0.749~~ (less than 75%).  And then you are scaling it another 33%.  That is a gigantic amount of scaling.  So if the original resolution was 200px wide, it is now 49.461~~.  A very unclean number, and less than 25% of its original size.  So unless you are running Mugen in a resolution with a vertical of 1920px (2560x1920), you are going to lose a huge amount of quality.

Thanks for the tips, it was essential. Gratitude!



     Posted: July 01, 2023, 01:29:06 am
Making the portrait bigger and scaling it later will not make it look better. The ideal scenario would be not scaling it at all, make it 1:1.
Or, if you're working on a hires screenpack but lowres characters (screenpack uses localcoord = 640,480 and characters use 320,240), you can scale it to .5 and it will look good.

Thank you my friend. I had this dilemma since I started creating my screenpacks. In fact my characters use 320,240 and my screenpack uses 1280,720. So face.scale = 0.25,0.25 worked fine for me.

     Posted: July 01, 2023, 01:33:43 am
I have one last question: Should I leave my chars at 320,240 or should I put another value to make it more interesting?
Re: PNG portrait with low quality
#12  July 01, 2023, 03:00:55 am
  • avatar
  • **
    • USA
Sorry, it took me a while to get back to this thread.

I don't know anything about Ikemen Go because I've never bothered with trying it, but it is possible to use hardware scaling in Mugen 1.1 OpenGL mode.  This can regain some (not all) image quality.  How you want to do this exactly will depend on your current screenpack and monitor, so I will only provide an example based on what I do.  Your results will vary.

Step 1: Configure Mugen for your screenpack
In my case, I use a 640x480 screenpack.  Mugen can be run in whole multiples of the screenpack size, so I choose x3.
Code:
[config]
GameWidth = 1920
GameHeight = 1440

Step 2: Hardware scaling
Now I am going to scale that down to my monitor size (1920x1200).  Since my screenpack is 4:3, this will result in a 1920x1200 window with vertical black bars on the side (1600x1200).  There are some settings further in the video section for managing that behavior if desired.
Code:
[video]
Width  = 1920
Height = 1200

Result?  I have way more pixels available than normal, and I'm using the video card to hide the evidence when I scale something.  That means I can scale any of my characters to an appropriate size and they won't look ugly.  Pretty cool trick.
Re: PNG portrait with low quality
#13  July 01, 2023, 04:08:24 am
  • ****
  • Formerly DeathScythe
    • Brazil
    • lyricasky.neocities.org
The idea is to use multiples of the resolution so it doesn't look "ugly".
Lowres chars comes in 320 x 240, hires is the double, 640 x 480. If you want widescreen, lowres 320 x 180, hires 640 x 360.
If these are too small, you can try:
1280 x 960 or 1280 x 720
1920 x 1440 or 1920 x 1080

And when scaling sprites, try half values: .5, .25, .125, etc.

My laptop has a small resolution so I always use 640 x 480, and portrait scale .5.
Re: PNG portrait with low quality
#14  July 01, 2023, 04:17:04 pm
  • **
    • Brazil
Sorry, it took me a while to get back to this thread.

I don't know anything about Ikemen Go because I've never bothered with trying it, but it is possible to use hardware scaling in Mugen 1.1 OpenGL mode.  This can regain some (not all) image quality.  How you want to do this exactly will depend on your current screenpack and monitor, so I will only provide an example based on what I do.  Your results will vary.

Step 1: Configure Mugen for your screenpack
In my case, I use a 640x480 screenpack.  Mugen can be run in whole multiples of the screenpack size, so I choose x3.
Code:
[config]
GameWidth = 1920
GameHeight = 1440

Step 2: Hardware scaling
Now I am going to scale that down to my monitor size (1920x1200).  Since my screenpack is 4:3, this will result in a 1920x1200 window with vertical black bars on the side (1600x1200).  There are some settings further in the video section for managing that behavior if desired.
Code:
[video]
Width  = 1920
Height = 1200

Result?  I have way more pixels available than normal, and I'm using the video card to hide the evidence when I scale something.  That means I can scale any of my characters to an appropriate size and they won't look ugly.  Pretty cool trick.

Thanks. I will test these methods.
Re: PNG portrait with low quality
#15  July 04, 2023, 05:05:22 pm
  • ****
  • commissions open bang my line
    • USA
    • https://www.paypal.com/paypalme/xtayisblackx?country.x=US&locale.x=en_US
go into config.json and look for

Code:
"PngSpriteFilter" :

and make sure that it says true after, that could help as well

here's a pic of my select screen with it set to "true"

Spoiler, click to toggle visibilty

and here it is with it set to "false"

Spoiler, click to toggle visibilty
My 2D stages folder:
https://app.mediafire.com/g5pnpb2im4lqa

MY 3D stages folder:
https://www.mediafire.com/folder/oz0kp2v4juism/3D_STAGES

Click here to join my discord server for updates to my content and more:
https://discord.gg/7VjyRw3xWB

~ taking commissions and working on my personal projects only right now. DM if interested ~
Re: PNG portrait with low quality
#16  July 05, 2023, 01:33:18 am
  • **
    • Brazil
go into config.json and look for

Code:
"PngSpriteFilter" :

and make sure that it says true after, that could help as well

here's a pic of my select screen with it set to "true"

Spoiler, click to toggle visibilty

and here it is with it set to "false"

Spoiler, click to toggle visibilty
Thank you my friend. I checked and it is true, in the option.
I think I managed to understand the dynamics with the tips here in the post. Previously I used the value of 427,240, to make the character smaller, and thus gain quality. Me too 0.33,0.33 on the scale of big portraits. Everything was poor quality.

Now I'm using 320,240 for characters and .25,.25 for big portraits. Everything was quality. This was an old question.
I'm starting to learn how to use Ikemen.