2

I've been trying to create a smudge tool for an image editing application I've been developing. I've found various resources around the web for smudge algorithms, but none of them take into account using a transparent background.

I can't "pick up and paste" a sample of the background because rendering it wouldn't smudge the transparency into the color, as you'd find on smudge tools in GIMP and Photoshop.

How can I smudge both transparency and color?

Kleptine
  • 5,089
  • 16
  • 58
  • 81
  • Why does transparency matter? It's just another channel, just like red, green or blue? – Novikov Dec 30 '10 at 01:27
  • Ah, that should have been obvious to me, though I suppose then the better question would have been how to edit channels with Android. I'll start a different question for that. – Kleptine Dec 30 '10 at 05:32

1 Answers1

1

It seems the answer that I'm looking for is to smudge each individual channel as a separate image (or at least the RGB and A channels separately). However, I can't seem to find a way to edit the channels of a Bitmap in Android.

I asked a separate question for that: Android Edit Bitmap Channels

Community
  • 1
  • 1
Kleptine
  • 5,089
  • 16
  • 58
  • 81
  • Hi, it's 4 years since your answer, but I'm really2 curious about your method. I wonder if you could give a little more info about how you did this? For example what blend mode did you use to blend the 2 RGB images together and the 2 Alpha channels. I'm creating a drawing app for a hobby and this thing drives me crazy, hehe. Thanks! – Coolant Jul 06 '14 at 09:04
  • If I recall correctly, I ended up dropping down into the NDK so that I could average the picked up sample image with the current canvas. – Kleptine Jul 10 '14 at 06:51
  • I used this overall algorithm: http://losingfight.com/blog/2007/09/05/how-to-implement-smudge-and-stamp-tools/ – Kleptine Jul 10 '14 at 06:52
  • And modified it to operate on the Alpha channel as well. Though as I said, there wasn't a blend mode that did exactly what I wanted, so I moved into the NDK to blend the images in a custom way. – Kleptine Jul 10 '14 at 06:53