Author Topic: Touchscreen brush "trailing" issue  (Read 4730 times)

nikescar

  • Guest
Touchscreen brush "trailing" issue
« on: February 23, 2010, 01:46:18 am »
First of all I would like to say great job on MyPaint. I tried using the SketchBook Pro Trial on my eeePC and it was a complete slide show. MyPaint runs flawlessly even when I put it on power save mode. Plus it has all the features I could ever want and it's FREE! Great work!

On to the problem. I'm using a eeePC running Windows. I installed a touch screen overlay this weekend and then installed MyPaint. It works great except for a trailing problem when picking up the stylus and then putting it down again. That means that after every stroke I get a dithering trail that goes from where I finished the last stroke to where I start my next stroke. After a little investigation I discovered it does this when using a mouse or the mousepad too only it's much less noticeable. When using the mouse, at the end of a stroke, I'll release the mouse button and then when I move the cursor it make a very tiny "finishing" stroke.

The picture below shows my problem. I made four lines from left to right. I drew the line the lifted and drew the line below it and so on. (nice looking zig-zag though)



I tried playing with the pressure sensitivity (even though my touchscreen isn't pressure sensitive) and that didn't help. I appreciate any help you can guys give.

jonnor

  • Guest
Re: Touchscreen brush "trailing" issue
« Reply #1 on: February 23, 2010, 01:37:09 pm »
The trailing lines, are they drawn as you move the pen or when the pen touches the surface again?

nikescar

  • Guest
Re: Touchscreen brush "trailing" issue
« Reply #2 on: February 23, 2010, 07:25:52 pm »
They are drawn after I touch the surface again to draw another line.

I think I understand what the problem is. It will only effect systems like mine where the touchscreen is emulating a mouse. The driver of my touchscreen makes windows see it as a standard mouse. Therefore when I lift the stylus off the screen the cursor stays in that position. Then when I touch the stylus to the screen the cursor moves in a fraction of a second (likely only a few clock cycles) to the new position. Given the built in "trailing" in MyPaint, this makes the dithering trail you see up there.

The only way for this to be fixed would be to disable what I'll refer to now as an after-stroke (instead of trailing). Do a test with your own mouse. Draw a nice well defined line. At the end of the line keep the mouse still and then stop drawing (let off the left mouse button). Then quickly move the mouse in any direction and you'll see a tiny after-stroke. Consider that no matter how hard you try you won't be able to move the cursor as quickly as the computer can update the cursor position from one location to another.

I hope I've explained this well enough.

Offline maxy

  • Moderator
  • Hero Member
  • *****
  • Posts: 558
  • Karma: +8/-1
Re: Touchscreen brush "trailing" issue
« Reply #3 on: February 23, 2010, 09:27:24 pm »
Sounds like you are seeing what others call "Ghost Lines": https://gna.org/bugs/index.php?13622

nikescar

  • Guest
Re: Touchscreen brush "trailing" issue
« Reply #4 on: February 23, 2010, 11:02:23 pm »
Thanks for that link. I'll give it a try.

According to that post they think it's a problem with pressure sensitivity but in my experience it's not. Like I said it happens with a mouse and not just when using a resistive touchscreen. After every line there is a small after-stroke. Besides if it was a pressure issue you'd think that line would be tapering and not just fading.

nikescar

  • Guest
Re: Touchscreen brush "trailing" issue
« Reply #5 on: February 24, 2010, 04:08:09 pm »
So I tried it and it doesn't make a difference. I also tried every brush setting. Nada.

I'm pretty disappointed. I tried out a lot of painting programs before I settled on this one. And given that this has been a bug for years I don't have much hope that it can be solved easily.

It might be worth the dev/devs looking into the fact that it happens with all input methods and not just resistive touchscreens. The only difference is the magnitude of the after-stroke.


Offline maxy

  • Moderator
  • Hero Member
  • *****
  • Posts: 558
  • Karma: +8/-1
Re: Touchscreen brush "trailing" issue
« Reply #6 on: February 24, 2010, 09:13:47 pm »
You are correct the problem is not pressure sensitivity, the problem is that we don't get any motion events when there is no pressure.

It seems to be a bit tricky to recognize the GTK events that we receive at "end of touch" reliably. I don't want to guess by the time that has passed between the events, and we have to ignore the button up/down events for normal tablets, otherwise we get glitches there.

Offline maxy

  • Moderator
  • Hero Member
  • *****
  • Posts: 558
  • Karma: +8/-1
Re: Touchscreen brush "trailing" issue
« Reply #7 on: February 24, 2010, 09:19:34 pm »
By the way, do you have pressure sensitivity at all? If not, then your tablet acts like a mouse, this case could be fixed a bit more easily maybe.

nikescar

  • Guest
Re: Touchscreen brush "trailing" issue
« Reply #8 on: February 24, 2010, 10:22:37 pm »
The touchscreen is a resistive type with no pressure sensitivity and it does indeed emulate a mouse. In one of the above posts I went into some detail about that.

I think I understand what you mean. With a normal tablet you have the pressure code do the work entirely. So essentially MyPaint is always in "down" mode. When a stylus gets close enough to the tablet/screen, MyPaint moves to that point and then once it reaches a certain closer distance (or touches the tablet/screen) it starts drawing a line.

Since button up/down events cause problems with real tablets maybe it could be a checkbox in settings for the cheap users like myself that have to resort to a $300 homebrew tablet.


Astapov

  • Guest
Re: Touchscreen brush "trailing" issue
« Reply #9 on: April 04, 2010, 08:45:59 pm »
@ nikescar: Just out of curiosity, what homebrew tablet do you have that cost you 300?

Wacom tablets are actually very cheap right now. And as far as I know theyre the best brand out there.

Small intuo on sale for  just over 200.

http://www.wacom.com/intuos/small.php

And if youre super short on cash you can get one of the bamboo models for under 100.

Ive had my intuo3 for four years of student living and these things survive fire water and all sorts of other hazards.

nikescar

  • Guest
Re: Touchscreen brush "trailing" issue
« Reply #10 on: April 05, 2010, 04:58:59 am »
Sorry, I meant tablet PC. It's a $250 eeePC with a touchscreen mod.

Astapov

  • Guest
Re: Touchscreen brush "trailing" issue
« Reply #11 on: April 05, 2010, 05:05:30 am »
Hm. That is interesting. In that case 300 is a great price.

Venator·Pacis

  • Guest
Re: Touchscreen brush "trailing" issue
« Reply #12 on: July 16, 2010, 12:46:01 pm »
Hello folks,

I just want to echo everything nikescar said. Amazing program, seemed just the ticket - but having the same deal-breaking issue as nikescar on my Samsung Q1 tablet PC :(

The solutions related to pressure sensitivity do not work for me either -- nikescar's theory about the source of the error seems correct to me.

A very poor workaround: after a stroke, if I tap where the stroke ended, and then make a new stroke somewhere else, the trail does not appear. I figure the tap registers as an 'empty' stroke, and when the program interpolates between that and the new stroke, there is nothing to be drawn.

That cumbersome hack doesn't work with any sort of spontaneous sketching though. It would be wonderful if the devs could make it so that the issue disappears in future versions.

Offline maxy

  • Moderator
  • Hero Member
  • *****
  • Posts: 558
  • Karma: +8/-1
Re: Touchscreen brush "trailing" issue
« Reply #13 on: July 16, 2010, 04:53:26 pm »
It escapes my understanding why you would want to use MyPaint on a device that does not report pressure levels, but here you have a fix for mouse painting that I expect will work for you, too: http://gitorious.org/mypaint/mypaint/commit/bedc2198fe4867 (pushed to git)

The issue with tablets that /do/ report pressure, but not motion without pressure, remains unsolved (need more info about the GTK events those devices generate to do anything about it).

Venator·Pacis

  • Guest
Re: Touchscreen brush "trailing" issue
« Reply #14 on: July 17, 2010, 01:51:34 am »
maxy my good fellow, you rock!

Works great!... except...

I tried making my own pencil brush, binding opacity to speed by setting the "opaque multiply" base value to 1 and its Fine speed value to -1. This gives strokes that nicely adapt to speed - but the spook lines between strokes are back :( Moreover when, with this brush, I move the cursor over the canvas with the USB mouse rather than using the touchscreen, a line is drawn wherever the cursor goes, even while not holding the left mouse button (when I do hold the LMB the line gets more opaque; both with and without LMB opacity depends on speed).

The problem does not occur when I bind radius or hardness to speed. So that gives almost the desired effect of stroke 'impact' being inversely proportional to speed; but it would be nice to be able to fine-tune it so radius, hardness and opacity all adapt to speed. This leads to:

Quote
It escapes my understanding why you would want to use MyPaint on a device that does not report pressure levels

If you saw a great scene, and you had only a biro, rather than great arts materials, would you refuse to draw?

Pressure sensitivity is the real deal. But given that I'm carrying my UMPC with me all the time, and that I have no inclination to add some more weight and lose some funds by adding a tablet - it's a delight to be able to whip up MyPaint. I had ArtRage in Windows (am now on Mint) and did a couple e-paintings which people seemed to like.

With acrylic paint style stuff in particular pressure is not that much of an issue, as you do light bits by using white paint anyway, not by applying less.

However for pencil style brushes some 'natural' variation in stroke impact is nice. Hence my trying to tie opacity to speed. Even with only radius and hardness tied to it, I think the effect looks pretty nice and 'alive'.

It may be a bit of a niche but I imagine there'd be quite a few users of mobile devices with simple touchscreens that will appreciate what can be done with the right software.

Finally, having explored MyPaint a bit more now - the brush options, canvas rotation, backgrounds, the elegant shortcut assignment... I'm in total awe.


 

Sponsor -> Günstige Soirée Robes de Cérémonie