-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When the 3-Pencils enhancement were done, here another suggestion #32
Comments
Is this not taken care of by #1246? |
@davidlamhauge In a way it does, but this has an extra requirement, and that is to specifically change the mentioned colors. With the current implementation you've linked every pixel in the canvas will be tinted in the new color, but with this issue the key is that you should be able to tint only the intended color. This usually requires a color sampling step to determine the hue of the color you want to replace before applying it. A sort of color filter if you will. Some apps do it with an HSVA or RGBA threshold, and ideally we should be able to replace the color with an alpha value as well. In that sense the current implementation would be missing that previous step in order for this issue to be fulfilled entirely. |
@Jose-Moreno Okay. I didn't read it properly. |
@davidlamhauge Actually I don't think the basic functionality has to change. It can still be thought to change the keyframe or layer contents, but the key difference is using a color threshold to filter which pixels are meant to be changed. So for example if I had 3 strokes, 1 red, 1 green and 1 blue, and picked the blue color using the eyedropper, that would make it so only the currently selected color as seen in the color box would be affected by the replacement color action. Technically I'm not sure how this is done or how to make it a "proper" algorithm that's optimized but what i'd do as a naive approach is to:
I mean it seems the replace color function already does the pixel search by transparency using the mBounds object and methods to check, so it should be possible to add a restriction to look for the picked color before applying the actual color. I also see that there are some utility methods used for the flood fill tool that could help with the specific color filtering like the scanline method and the compareColor method in bitmap.cpp
In essence the previous step we're looking for should be very similar to what the bucket tool is already doing, but we trade the user input for a canvas grid search, adjusting filtered pixels by hue & alpha threshold. The floodfill algorithm is not perfect of course, but these concepts should make it possible to achieve the overall goal. At least that's my impression of it, but I could be wrong of course. |
After working with this 3 colour lines into separated layers, it would be a new implementation to this state to have functions which allow these same colour lines to be changed into one of the others,
for example a frame with rough drawings done with the Blue-Pencil could have its lines be turned into Black lines if they are susceptible to be used as finish lines.
I think it has something to do with an Alpha channel/layer that is pasted in front of that frame when we desire to change that lines
The text was updated successfully, but these errors were encountered: