It is currently Tue Oct 17, 2017 11:48 am

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: Tue May 23, 2017 10:32 am 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3071
Location: Nacogdoches, Texas
I had noticed this when making my school presentation and found it to be a serious flaw, but hadn't gotten the chance to make a post or had forgotten, but it's summer for me now. Anyway, I made a text file for myself that has all 32 shades per 5bit channel RGB translated to 8bit per channel RGB by taking 255, dividing it by 31 to get about 8.2258, then multiplying that number by 0-31 and recording the products:

Code:
0
8
16
25
33
41
49
58
66
74
82
91
99
107
115
123
132
140
148
156
165
173
181
189
197
205
213
222
230
239
247
255

However, even though I had used only these numbers for the colors in my indexed picture, PCX2SNES did not generate a palette with color entries that corresponded to what they should be. Then I thought that maybe, they were just dividing 256 by 32 and either treating everything darker than 8 as 8 in 24bit RGB before transferring it to 0 in 15bit RGB, or treating everything brighter than 248 as 248 in 24bit RGB before transferring it to 31 in 15bit RGB, so 24bit RGB is just 15bit RGB multiplied by 8. But based on the colors I got, and what I can't even wrap my mind around as to why it was made to do this, it can't be doing either of these, because despite my picture only having different shades of pure gray (all channels have the same value), the colors it generated did not always have the same brightness in every channel, which I can only assume is because they did not separate the color channels or something when performing calculations on them. Needless to say, the result looked like ass and I had to edit the colors in a hex editor, which was a lot more time consuming and taxing on my brain than it should have been. :lol:

So incase you haven't arrived at this conclusion already, do yourself a favor and don't use PCX2SNES. :wink:


Last edited by Espozo on Tue May 23, 2017 11:34 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Tue May 23, 2017 11:32 am 
Offline
User avatar

Joined: Sat Jan 03, 2015 5:58 pm
Posts: 367
Location: ...
I've always assumed that pcx2snes secretly runs neviksti's palette correction program inside itself before calculating the palette. My only guess as to why it isn't always accurate.

Is that true? No one's ever gonna dig through an x86 binary to find out so I say forget about it and use snes tile tool.


Top
 Profile  
 
PostPosted: Tue May 23, 2017 12:30 pm 
Offline

Joined: Tue Oct 06, 2015 10:16 am
Posts: 554
The source is available according to google?


Top
 Profile  
 
PostPosted: Tue May 23, 2017 1:17 pm 
Offline
User avatar

Joined: Sat Jan 03, 2015 5:58 pm
Posts: 367
Location: ...
calima wrote:
The source is available according to google?

Seems so. Would have been nice back in early 2015 when I couldn't find it anywhere, and part of me doesn't even want to take back my earlier statement for that reason. Distributing executables only for a one-file C program is bleh.


Top
 Profile  
 
PostPosted: Tue May 23, 2017 2:41 pm 
Offline
User avatar

Joined: Tue Apr 05, 2016 5:25 pm
Posts: 121
Isn't pcx2snes really old? I've been using gfx2snes (which is also kind of buggy I think).

This reminds me that I'm glad I made my own palette editor so I can fix the colors post conversion but now that I think about it, I display those colors on-screen by multiplying the channel value by 8... But I don't think too much of it because I mostly just care about the colors fading smoothly with each step (something you can't count on when you don't know exactly how the colors will be quantized).

_________________
SNES NTSC 2/1/3 1CHIP | serial number UN318588627


Top
 Profile  
 
PostPosted: Tue May 23, 2017 2:53 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5709
Location: Canada
I probably say this too often, but... it might be a good idea to write your own tool. :beer: :D


Top
 Profile  
 
PostPosted: Fri May 26, 2017 8:00 pm 
Offline

Joined: Fri Jul 04, 2014 9:31 pm
Posts: 781
I've looked at this before. IIRC it's alternating the error sign over the RGB channels in an attempt to improve brightness preservation, or something like that.

This might just possibly be somewhat justified when processing an arbitrary 24-bit image, but when the image is using pre-quantized pseudo-15-bit colour, adding chroma dither will make it look worse.

I write my own tools in Matlab. With all the weird stuff I do, I basically end up writing a new tool every time I want to do something...


Top
 Profile  
 
PostPosted: Sat May 27, 2017 6:45 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1770
Location: DIGDUG
In GIMP, you can switch to indexed mode, and specify the number of colors. Then you can open the color map dialogue box, to view/edit the colors.

Then i suppose you could convert from hex to 15 bit, or write a tool, like rainwarrior is often suggesting, to get the values from an indexed image file.

Why reinvent the wheel? If GIMP does a good job, why waste time writing the code?

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Sat May 27, 2017 10:28 am 
Online

Joined: Sat Apr 25, 2015 1:47 pm
Posts: 327
Location: FL
dougeff wrote:
If GIMP does a good job, why waste time writing the code?

I think GIMP's history of being buggy and having serious UI design issues leaves a lot of people preferring to use basically any other available option, including the DIY approach.

Of course, there are other image editors with easy support for indexed images and palette editing, but the only one I've personally used myself is Paint Shop Pro.


Top
 Profile  
 
PostPosted: Sat May 27, 2017 10:32 am 
Offline
User avatar

Joined: Tue Apr 05, 2016 5:25 pm
Posts: 121
GIMP is not a particularly great choice for pixel art. Right now I'm thinking the best way to go about this is to export from Aseprite without worrying too much about quantizing the colors, then double-checking and correcting them after the conversion using a raw SNES palette editor.

_________________
SNES NTSC 2/1/3 1CHIP | serial number UN318588627


Top
 Profile  
 
PostPosted: Sat May 27, 2017 10:41 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10046
Location: Rio de Janeiro - Brazil
If you know how to work with indexed images, GIMP and Photoshop can be decent pixel art editors. Photoshop even allows you to change the image's aspect ratio (maybe GIMP does too?), which's really useful for retro consoles that hardly ever had square pixels. I don't think I've seen this feature in other common pixel art tools.


Top
 Profile  
 
PostPosted: Sat May 27, 2017 10:53 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5709
Location: Canada
tokumaru wrote:
If you know how to work with indexed images, GIMP and Photoshop can be decent pixel art editors. Photoshop even allows you to change the image's aspect ratio (maybe GIMP does too?), which's really useful for retro consoles that hardly ever had square pixels. I don't think I've seen this feature in other common pixel art tools.

I use GIMP for most of my pixel art. I much prefer it to Asperite for everything except animation; GIMP has no real animation tools. I found aseprite is a lot more intuitive (especially when working with palettes), but once over the learning hump with GIMP it has a much better set of drawing features, IMO.

This tutorial really helped me get into GIMP: https://www.youtube.com/watch?v=PONe4IIYSnQ

Yes, GIMP has PAR options. Turn off "Dot for Dot" in the "View" menu, and then go to "Image -> Print Size..." to adjust its aspect ratio. (You can have multiple views open too, in case you want to view both at once, or edit on a 1:1 version while seeing those changes in the different PAR.)


Top
 Profile  
 
PostPosted: Sat May 27, 2017 11:22 am 
Offline

Joined: Fri Jul 04, 2014 9:31 pm
Posts: 781
GIMP also has a Posterize function that, when set to 32 levels, gives you effectively 15-bit colour. The "Colorcube Analysis" tool counts the number of colours in an image, so you can tell if you're over the limit even if you aren't using Indexed mode. You can even save bitmaps in X1R5G5B5, eliminating the need for your custom SNES graphics tool to do any colour conversion (unless it's on a platform that can't read 15-bit bitmaps...).


Top
 Profile  
 
PostPosted: Sat May 27, 2017 11:35 am 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3071
Location: Nacogdoches, Texas
93143 wrote:
You can even save bitmaps in X1R5G5B5, eliminating the need for your custom SNES graphics tool to do any colour conversion

really?!? :D

93143 wrote:
(unless it's on a platform that can't read 15-bit bitmaps...).

Oh... :cry:

Well, you can use PCX2SNES (I still haven't tried anything else yet, as I haven't converted any graphics since making this thread) and after it generates the wrong palette, open up the 15bit bitmap (you can even put all the different colors in order at the top left of the image) in HxD and use those hex values instead of trying to do it in your head, which, if you're me, should be 100x faster. :lol:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group