Skip to content
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

soft brush lines go under other lines #206

Open
L1NZ0 opened this issue May 28, 2023 · 6 comments
Open

soft brush lines go under other lines #206

L1NZ0 opened this issue May 28, 2023 · 6 comments
Labels

Comments

@L1NZ0
Copy link

L1NZ0 commented May 28, 2023

Ask a question related to OpenToonz

I have this problem where whenever I try to draw a line with a brush that is not fully opaque or has soft edges it doesn't properly go over other lines in toonz raster layers. It's as if the draw order is always on under all when it isn't.

lines

I first drew the black line, then the red lines. The left red line has a hardness of 0 and is fully underneath the black line. The second lines hardness is 40 and is partly under it. Only the fully opaque part of the line stays visible over the black line.

How do I fix this? I have no clue what could have caused this or what to do. Any help would be appreciated.

@L1NZ0 L1NZ0 added the question label May 28, 2023
@Bracket-H
Copy link

Bracket-H commented May 28, 2023

I haven't checked in the code but I think toonz raster layers are split in several ways. Solid lines. Fills, and soft stuff.

And that soft stuff behaves weirdly. I think the most extreme example I've found was using the file browser, to right click convert a jpeg into a toonz raster file, and choosing painted aliased source, or something.

And I just got this weird greyscale image (which I think OT interprets as the index 1 ink color) that behaved very weirdly.

A lesser example is using mypaint brushes on the toonz raster level, anything that's not soft is solid (obviously) but the soft stuff behaves strangely again, especially when painting textured soft parts over existing textured soft parts.

The pixels kind of meld and look like they're posterized or something.

If there's an easy 'one click' solution to that, then I do not know it.

...well, other than either sticking to aliased pencil mode, or:

only using strokes that have the pencil mode unticked/disabled.

Mixing them, and using over all, creates these artifacts due to that behavior.
Even keeping it all 'non pencil' creates them, but I don't think it matters much on thin (~3-5 pixel max) line weights, especaily with added antialiasing later.

If you want chuuunkkkky lines, then that issue might be worse for you.

A way around it is to draw the outline of a thick line, and fill it. Might sound crazy but thats actually how it's (usually?) done in anime.

Even the even more stylized, cartoony ones, like panty and stockings, which looks more like power puff girls than anything.
I distincly remember seeing a making of that had the thick lines all the characters have as thin outlines.

Add:
Like so
https://www.sakugabooru.com/data/29646a70a8abac79e6a59cb9122f00e7.gif

@RodneyBaker
Copy link
Collaborator

Unfortunately, soft brushes can be problematic with toonz raster levels.
A recent change somewhat improved that but...

There are a few workarounds that might be worth investigating.

  1. Use raster levels and not toonz raster (convert later if necessary)
  2. Draw under/over into levels inside other columns of the xsheet (the layers can all be of the same level just spread out)... then merge them down into one level via 'Merge TLV levels'.

image

Not an ideal solution but this might be worth pursuing depending on your requirements.

@JParks123
Copy link

just use the match lines feature.

@Bracket-H
Copy link

Match lines are an S-Tier feature, yes. Very powerful.

@RodneyBaker
Copy link
Collaborator

RodneyBaker commented May 29, 2023

Here's a link if interested in pursuing the Merge or Match Lines approach.
(There are other merge processes not covered in the video as well)

Link: https://www.youtube.com/watch?v=AMJHpoyBVAg

@shun-iwasawa
Copy link
Member

In a typical raster image, each pixel has 8 bits of information for each of the four RGBA channels. (i.e. 4x8=32bits per pixel)

In contrast, in a Toonz raster image, each pixel has the following information:

  • Line style index (12 bits)
  • Fill style index (12 bits)
  • Tone: the mixing ratio of line and fill colors (8 bits, 0 for pure line, 255 for pure fill)

This specification allows very powerful palette-based color management.
However, an important drawback is that Toonz raster images cannot represent colors mixing two lines of different colors together. This is because each pixel can only store one line style index.

A solid brush replaces the Tone of the pixels on the stroke with 0 (pure line).
A soft brush, on the other hand, draws pixels with a gradual change in Tone on both sides of the stroke.

When soft brush strokes intersect, under the current specification, the stroke with the smaller Tone (i.e., the darker line) is selected as the resulting pixel. This is why you get strange bridging results at intersections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants