chrismaltby / gb-studio

A quick and easy to use drag and drop retro game creator for your favourite handheld video game system
https://www.gbstudio.dev
MIT License
8.59k stars 475 forks source link

Auto-color background PNG files when imported #705

Open Jeltr0n opened 3 years ago

Jeltr0n commented 3 years ago

Auto-coloring color pngs It would be very useful if GBstudio could auto-generate the necessary palettes and assign them to the tiles. It's challenging to make full color art that follows the Game Boy Color's limitations but it would really improve the workflow if there wasn't additional work in GBStudio to color an image that's already in color in an external editor.

Describe the solution you'd like Here is how I imagine it would work: It would check each 8x8 tile for 4 colors, assign the nearest GB Color based on the hex color converter that already exists, then assign the colors in order of brightness to the 4 default green colors. It would check if a palette with those 4 colors already exists. If so, it would use that palette. If not, it would create a new palette with the png image's name followed by a number. (You could rename it later if you want) If you exceed 4 colors within a tile or the total number of palettes it would give you an error message.

Describe alternatives you've considered The alternative is the current method which works well if the number of palettes and backgrounds is limited but creates a tedious workflow if there are a large number of backgrounds and/or palettes. Speaking from the perspective of an artist that would like to use the full potential of the Game Boy' graphical capabilities, I think the current workflow is more limiting than the Game Boy's hardware limitations.

Additional context workflow

palette method naming method

danveloso11 commented 3 years ago

I think I can make a temp fix as an external unrelated javafx program that does this, I could publish it as an executable and you would be able to generate the palette setups, but you'd have to put em into the game individually.

maxoakland commented 3 years ago

I think I can make a temp fix as an external unrelated javafx program that does this, I could publish it as an executable and you would be able to generate the palette setups, but you'd have to put em into the game individually.

That would be a good thing! I think people would love that

danveloso11 commented 3 years ago

I think I can make a temp fix as an external unrelated javafx program that does this, I could publish it as an executable and you would be able to generate the palette setups, but you'd have to put em into the game individually.

That would be a good thing! I think people would love that

It's got to be after mid August though as I have no free time right now but I will get to it

Jeltr0n commented 3 years ago

Hey Dan- Did you ever get a chance to revisit this?

danveloso11 commented 3 years ago

I'm sorry I have not had time yet. I am working full time and making a portable retropie and a game at the same time haha, I have too many things to juggle right now. Maybe in the near future

On Tue., Aug. 17, 2021, 5:24 p.m. Jeltr0n, @.***> wrote:

Hey Dan- Did you ever get a chance to revisit this?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/chrismaltby/gb-studio/issues/705#issuecomment-900640799, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUKJ332MMNTTCPJGXR3T3UTT5LHPHANCNFSM4WK7WIWA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

Jeltr0n commented 3 years ago

No problem, Let me know if you ever get a chance to revisit this because it would save us a ton of time! Maybe if it works well enough the same system could be added to GB Studio.

chrismaltby commented 7 months ago

Finally managed to have a look at this and have an auto color feature in place for the next release

Screenshot 2024-04-23 at 12 56 03

that specific image had a few minor issues, the pixels shown in green were a slightly different shade of white causing it to need more the allowed amount of palettes and the tile with the red border contains 5 unique colors. Screenshot 2024-04-23 at 12 58 14 Once those are fixed it is working as expected!

Jeltr0n commented 7 months ago

Oh wow that's incredible! I had no idea this was on your radar. I'm very excited to try it out. Sorry my example image was hard to work with. If I knew you were going to test with it I would have cleaned it up!

chrismaltby commented 7 months ago

no need to apologise, it was a good test for the algorithm!