Erase only WHITE lines? Topic is solved

Please use this part to report bugs & errors, ask questions & "How to..."
Post Reply
User avatar
Sewie
Posts: 1257
Joined: 18 Jun 2008, 11:57
Location: The Netherlands, Europe
Contact:

Erase only WHITE lines?

Post by Sewie » 10 May 2017, 11:06

Dear TVP friends,

I'm trying to create a eraser that will only erase WHITE lines, but I'm at a loss. I tried to adjust one of the opacity erasers ('erase only black lines' for example) by fiddling with the george code for the color, but I get very strange results... Can someone help me or explain what I can do to achieve such a result?
Michael Sewnarain - Website
Windows 10/64b - TVP11.0.8 - Pro/64b - Cintiq24HD

User avatar
slowtiger
Posts: 2340
Joined: 08 May 2008, 21:10
Location: berlin, germany
Contact:

Re: Erase only WHITE lines?

Post by slowtiger » 10 May 2017, 11:14

What's the context? If it's only black and white lines, I'd use Scan Cleaner.
TVP 10.0.18, Mac Pro Quadcore 3 GHz, 16 GB RAM, OS 10.11, QT 7.7.3

User avatar
schwarzgrau
Posts: 1055
Joined: 23 Jan 2012, 22:08
Location: Offenbach / Germany
Contact:

Re: Erase only WHITE lines?

Post by schwarzgrau » 10 May 2017, 13:29

I made you one (the icon is still wrong). I still don't know how this colorcodes work, but I just looked at the color codes from the other magic erasers and try to combine them in some way.

tv_custommode 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 -1 0 0 1 0 (red)

tv_custommode 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 -1 0 1 0 (green)

tv_custommode 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 -1 1 0 (blue)

tv_custommode 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 -1 1 0 (white)

I'm really not sure if it works as good as the other, but it seems to work.
Maybe the TVPain team could tell us how the color codes really work or change them to something more common like RGB.
Attachments
WhiteEraser.tvpx.zip
(1.83 KiB) Downloaded 206 times
Mac OS X 10.11.6 / TVP 11.0.8 PRO / Cintiq 22HD
Mac OS X 10.11.6 / TVP 11.0.8 PRO / Cintiq Companion 2
SCHWARZGRAU.COM

User avatar
Sewie
Posts: 1257
Joined: 18 Jun 2008, 11:57
Location: The Netherlands, Europe
Contact:

Re: Erase only WHITE lines?

Post by Sewie » 10 May 2017, 19:56

Thank you so much, Marc (Rühl)!

I found this Wiki page but I couldn't make it out properly. Did you use trial and error to find the code for white? I can see where you activate all the red, green and blue channels but 'm not clear on how you figured out how to create white. The trick is in those last 5 digits, isn't it...?
slowtiger wrote:
10 May 2017, 11:14
What's the context? If it's only black and white lines, I'd use Scan Cleaner.
It's for sketching with black and white lines on a tinted background. It'd be handy if I could erase both colors separately.

So I've made an icon for the white eraser. Now you can recognize it easily in the interface:
WiteEraser_Icon.PNG
WiteEraser_Icon.PNG (2.05 KiB) Viewed 15640 times
WhiteEraser - Mike.zip
(2.02 KiB) Downloaded 236 times
Michael Sewnarain - Website
Windows 10/64b - TVP11.0.8 - Pro/64b - Cintiq24HD

Svengali
Posts: 1244
Joined: 28 Dec 2006, 10:08
Contact:

Re: Erase only WHITE lines?

Post by Svengali » 10 May 2017, 22:04

Another option which seems to leave no fringing (works like a scan cleaner brush) :
scan-cleaner-brush.jpg
scan-cleaner-brush.jpg (6.4 KiB) Viewed 15571 times
Sven
Last edited by Svengali on 11 May 2017, 17:33, edited 1 time in total.
Desktop: tvp Pro 11.0.8-64bit, Win8.1 - 24GB ram -2TB HHD - 256GB SSD - intuos4 - d.ver.6.3.15-3
Android Tablet: release 11, Samsung Galaxy Note10.1 - 32GB internal - microSD 32GB

o0Ampy0o
Posts: 115
Joined: 25 Oct 2015, 22:26

Re: Erase only WHITE lines?

Post by o0Ampy0o » 11 May 2017, 02:20

Sewie wrote:
10 May 2017, 19:56
It's for sketching with black and white lines on a tinted background. It'd be handy if I could erase both colors separately.
Whenever I think of drawing with similar material I think of Perre-Paul Prud'hon's work.

Image

Head of Vengeance from the collection at the Art Institute of Chicago.
Main System: Mac Pro running OS X: 10.10.5 | 3.8GHz i7 | 32GB RAM | NVIDEA GeForce GTX 970 4GB | 64-bit TVPaint Pro 11.0.6 | iPad Pro, Apple Pencil and Astropad | Wacom Intros Pro using Driver: 6.3.21-8

User avatar
Sewie
Posts: 1257
Joined: 18 Jun 2008, 11:57
Location: The Netherlands, Europe
Contact:

Re: Erase only WHITE lines?

Post by Sewie » 11 May 2017, 10:06

Svengali wrote:
10 May 2017, 22:04
Another option which seems to leave no fringing (works like a scan cleaner brush) :

tv_custommode -1 0 0 0 0 0 -1 0 0 0 0 0 -1 0 0 0 0 0 0 -1 1 0 (white)

Sven
So, Sven, what is the rationale behind finding that color code? How did you decide on this...? Might be good for us to learn a little about the basics of George.
I'm asking because frankly I find that Wiki Page I linked a little cryptic.

Edit: Btw, pasting your code into the brush's properties does not work, it leaves me with a regular vanilla eraser brush. Schwarzgrau's brush works perfectly, though.

o0Ampy0o wrote:
11 May 2017, 02:20
Sewie wrote:
10 May 2017, 19:56
It's for sketching with black and white lines on a tinted background. It'd be handy if I could erase both colors separately.
Whenever I think of drawing with similar material I think of Perre-Paul Prud'hon's work.

...

Head of Vengeance from the collection at the Art Institute of Chicago.
Wow!
Michael Sewnarain - Website
Windows 10/64b - TVP11.0.8 - Pro/64b - Cintiq24HD

User avatar
schwarzgrau
Posts: 1055
Joined: 23 Jan 2012, 22:08
Location: Offenbach / Germany
Contact:

Re: Erase only WHITE lines?

Post by schwarzgrau » 11 May 2017, 12:33

Sewie wrote:
10 May 2017, 19:56
I found this Wiki page but I couldn't make it out properly. Did you use trial and error to find the code for white? I can see where you activate all the red, green and blue channels but 'm not clear on how you figured out how to create white. The trick is in those last 5 digits, isn't it...?
Hehe yea kind of trail and error. Honestly I was surprised too, cause none of the colors is really "pure". Like pure blue or pure green. But somehow it worked. And to be honest I have absolutely no idea what the last 5 digits do. I checked the wiki page too a few month ago and couldn't figure it out. But I'm glad it worked and I could help.
Sewie wrote:
10 May 2017, 19:56
So I've made an icon for the white eraser. Now you can recognize it easily in the interface:
WiteEraser_Icon.PNG
Oh great, this way it will fit nice in my custom panel.


EDIT: Maybe even if the colors are not pure, the eraser still works, cause one of the numbers (maybe the last one) is some kind of threshold. So the code I used isn't really pure white, but kind of and the threshold makes it work with white.
No, I've tried something and it seems to be wrong.
Mac OS X 10.11.6 / TVP 11.0.8 PRO / Cintiq 22HD
Mac OS X 10.11.6 / TVP 11.0.8 PRO / Cintiq Companion 2
SCHWARZGRAU.COM

Svengali
Posts: 1244
Joined: 28 Dec 2006, 10:08
Contact:

Re: Erase only WHITE lines?

Post by Svengali » 11 May 2017, 18:43

Sewie,
I updated the numbers in my previous post with a screen capture... try substituting those again.
The forum editor removes spaces making the parsing of the r g b a k values run together.

I know absolutely nothing about manipulating pixel color matrices. But my logic in this specific case (removing white and leaving black using the pixel matrix) went something like this:

Each of the inserted -1 values for Red r, Green g and Blue b removes those component colors, which combined = white.
As to the 0 0 -1 1 0 for Alpha section? Not sure but I think g = 0 removes the green alpha channel, r = 0 removes the red alpha... channel b = -1
sustains the existing opacity percentages of the solid black and partial black areas. the a = 1 makes the pixel retain the previous alpha value for each area.

Maybe Eric Scholl can clarify about -1 used in pixel color matrices.

Sven
Desktop: tvp Pro 11.0.8-64bit, Win8.1 - 24GB ram -2TB HHD - 256GB SSD - intuos4 - d.ver.6.3.15-3
Android Tablet: release 11, Samsung Galaxy Note10.1 - 32GB internal - microSD 32GB

User avatar
Sewie
Posts: 1257
Joined: 18 Jun 2008, 11:57
Location: The Netherlands, Europe
Contact:

Re: Erase only WHITE lines?

Post by Sewie » 11 May 2017, 21:12

Svengali wrote:
11 May 2017, 18:43
Sewie,
I updated the numbers in my previous post with a screen capture... try substituting those again.
The forum editor removes spaces making the parsing of the r g b a k values run together.

...
Sven,
Just tried it again, exactly as you said, and I'm telling you: it erases everything.
Have you tried it yourself?
Michael Sewnarain - Website
Windows 10/64b - TVP11.0.8 - Pro/64b - Cintiq24HD

Svengali
Posts: 1244
Joined: 28 Dec 2006, 10:08
Contact:

Re: Erase only WHITE lines?

Post by Svengali » 12 May 2017, 03:23

Sewie,
Seriously? I ALWAYS test out suggestions I make or buttons/scripts I create. Only then do I post, after I know they work on MY system.

Here's a video of how the eraser works for me along with my version of the brush...
Scan Cleaner Brush Demo.gif
Scan Cleaner Brush Demo.gif (5.31 MiB) Viewed 15553 times
EDIT: note that the Scan Cleaner Brush has been updated so that it CORRECTLY CONVERTS any and all color pixels as well.
Attachments
ScanCleanerBrush.tvpx
updated 5/19/2017
(94 KiB) Downloaded 219 times
Last edited by Svengali on 19 May 2017, 09:55, edited 1 time in total.
Desktop: tvp Pro 11.0.8-64bit, Win8.1 - 24GB ram -2TB HHD - 256GB SSD - intuos4 - d.ver.6.3.15-3
Android Tablet: release 11, Samsung Galaxy Note10.1 - 32GB internal - microSD 32GB

User avatar
Eric Scholl
Posts: 1303
Joined: 04 Apr 2011, 14:40

Re: Erase only WHITE lines?

Post by Eric Scholl » 12 May 2017, 07:01

There is already some explanations about pixel matrix here : http://wiki.tvpaint.com/index.php?title=Tv_PixelMatrix
By the way, the script is working here : it erases the white, but for other colors, the more the color is close to white, the more it will be transparent.

User avatar
Sewie
Posts: 1257
Joined: 18 Jun 2008, 11:57
Location: The Netherlands, Europe
Contact:

Re: Erase only WHITE lines?

Post by Sewie » 12 May 2017, 07:55

Svengali wrote:
12 May 2017, 03:23
Sewie,
Seriously? I ALWAYS test out suggestions I make or buttons/scripts I create. Only then do I post, after I know they work on MY system.

...
Sorry to have insulted you, Sven. I've downloaded your brush and it works perfectly.

I think my mistake was with the spaces between the digits, as you mentioned, but I assumed it was 1 space between the digits and 2 between the digits of the color groups. But it's 2 spaces between digits and one EXTRA (so 3 spaces) between the color group digits.

Eric, I've looked at the link you posted but as I mentioned earlier in this thread, I find it very cryptic. It doesn't clarify to me how the color coding works...
Could you please explain some more?
Michael Sewnarain - Website
Windows 10/64b - TVP11.0.8 - Pro/64b - Cintiq24HD

Svengali
Posts: 1244
Joined: 28 Dec 2006, 10:08
Contact:

Re: Erase only WHITE lines?

Post by Svengali » 12 May 2017, 12:06

Sewie, No problem...

I need to say that, while the Scan Cleaner version of the white eraser brush works, I'm still not sure why.

I do know from tests that the -1 in the blue alpha position is what makes it work... alternately, It also works if -1 is placed exclusively in the red alpha or the green alpha position instead.

But if my version of the Scan Cleaner brush is applied to any color pixel areas, the blue component of each affected pixel is erased. I could not find a combination of values that would erase white and leave the color pixels intact.

Bottom line, the Scan Cleaner version is only effective for use with black, gray and white images.

Sven

Edit: Success! After further testing... the new version of Scan Cleaner Brush (down load above) now correctly converts any and all color pixels.
Desktop: tvp Pro 11.0.8-64bit, Win8.1 - 24GB ram -2TB HHD - 256GB SSD - intuos4 - d.ver.6.3.15-3
Android Tablet: release 11, Samsung Galaxy Note10.1 - 32GB internal - microSD 32GB

Post Reply