piskelapp / piskel

A simple web-based tool for Spriting and Pixel art.
http://piskelapp.com
Apache License 2.0
11.25k stars 788 forks source link

Use determined Color Palette #784

Open Daragox opened 6 years ago

Daragox commented 6 years ago

Hello! I think I posted this in another place but I guess this is the correct one,

I have been using Piskel a lot lately because I am using it to creat patterns to make with Artkal beads and I think that a nice feature would be that once you selected a desired palette, when you upload an image, it would be great that Piskel change and use the colors from your palette that gets closer of almost the same from the original picture.

I don't know if you get my idea but since I (and hopefully more people) have a palette for artkal beads, I owuld like it to show only those colors, it would be a time saver! :)

juliandescottes commented 6 years ago

If I understand correctly, you would like to reduce the number of colors from the current image to match a certain palette.

Basically, for each pixel of the image, we would check which color from the palette is the "nearest", and would recolor the pixel based on that.

We could do a simple transform button, that takes the current layer of the current frame (or all frames and layers if holding ctrl/shift) and does this with the currently selected palette.

It reminds me of another transform I wanted to have in the application, just to reduce the number of colors in an image, but without giving it a target palette.

And it also sounds connected to #497 which was about mapping colors (to quickly recolor a sprite for instance).

Daragox commented 6 years ago

Basically, for each pixel of the image, we would check which color from the palette is the "nearest", and would recolor the pixel based on that.

Yes this is what I meant and I think this would be great for a lot of "beaders" like myself, it would save a lot of time :D

Ps: you are great :D

PrashBricks commented 6 years ago

Sounds cool, makes porting NES games to GameBoy a lot easier. Lol, I gave my own reaction a thumbs up and a heart...

juliandescottes commented 6 years ago

@JMiller-2020 pinging you here since you opened #812 :)

I started a branch a few weeks ago. I should update it again with the latest commits I made. UI-wise I went straight for a new dialog, because I wanted to have several color transforms, some of which that really need their own UI (map color by color instance). For now this dialog is accessible via a new icon in the transform section but that's not great since it differs from all the other transforms. Maybe something in the palette section would be more appropriate.

The branch also contains a bit of code to recolor the sprite using the current palette, which I think is what you wanted to do in #812 . I'm more than happy to let you pick that up, focusing on this single transform, I don't think I'm anywhere close to finishing the full dialog :)

Regarding "where to put this in the UI", I think a new transform icon is fine for this single action, but if you think it's a bad spot, happy to discuss!

jacob-miller-hq commented 6 years ago

Great! I'm gonna see if I can get Floyd-Steinberg working, though I am pretty new to the workflow. I'll let you know!

jacob-miller-hq commented 6 years ago

Oh, and regarding the UI location, I didn't think it was a bad spot, I just didn't want to do it wrong.

Luigi86101 commented 6 years ago

How do you get this to work? Is it still in the transform section? I only see five options: flip, rotate, clone, center, and crop.

jacob-miller-hq commented 6 years ago

This is not in the public build yet. Until it's merged, you have to download the branch and run it on a local server to access these features.

Kflash2814 commented 1 year ago

@juliandescottes 5 Years later, will this be moved to the public branch at all?