/ aseprite Public

Onion skinning with tinting does not work for all colors#1125

Closed
opened this issue May 8, 2016 · 4 comments
Closed

Onion skinning with tinting does not work for all colors #1125

opened this issue May 8, 2016 · 4 comments
Assignees
Labels
Milestone

Cerno-b commented May 8, 2016

 I love the onion skinning function but ran into some trouble recently when I tried the red/blue tinting for black pixels, which does not work (you only get grayscale onion skinning). So I ran some tests. Top to bottom: white, black, blue, green, red. Left column: Previous frame Right column: Next frame So some colors seem to have trouble getting the tinting right. Instead of using the original onion skin and tinting it, I would suggest the following: As an example, I will take a black pixel at 000000FF, which currently does not work at all in tinted onion skin. I will assume that the prev tint is supposed to be red with some alpha: FF000040. The process is as follows: Convert the prev cel to grayscale (since our pixel is black, this is still 000000FF) Calculate the per-channel average of the grayscale from 1. (000000) and your target tint (FF0000). Note I left out the alpha channel. You get (7F0000). Replace the prev cel's alpha with the target tint alpha, so you get 7F000040. Let's repeat this for a white pixel FF0000FF: Convert to grayscale (still white): FF0000FF: Calculate average of orignal FF0000 and target tint FF0000, so you get FF0000. Add the target tint alpha for the final result: FF000040 Final example for a medium gray pixel at 7F7F7FFF: Convert to grayscale (still gray): 7F7F7FFF Calculate average of 7F7F7F and FF0000 to get BF4040 Add the target tint alpha for the final result: BF404040 Visualization here: Since this seems to work for the whole grayscale spectrum and you can convert any color cel into grayscale, this should do the trick. You may want to add some weight factors to give it a little more contrast between white and black but in general it should be able to solve the problem. Please let me know what you think. The text was updated successfully, but these errors were encountered:
added the bug label May 9, 2016
added this to the v1.1 milestone May 9, 2016
self-assigned this May 9, 2016
closed this as completed in ``` 736f631 ``` May 10, 2016

dacap commented May 10, 2016

 Thanks for the details @Cerno-b, I've implemented this for the next release v1.1.5.3

Cerno-b commented May 13, 2016

 Wow, you're fast! Looking forward to the next release then :)

Cerno-b commented May 13, 2016

 I haven't been at my PC for a while, that's good news!