RSS/Atom feed Twitter
Site is read-only, email is disabled

Gimp Perspective Clone Tool

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

13 of 15 messages available
Toggle history

Please log in to manage your subscriptions.

Gimp Perspective Clone Tool Dave Neary 03 Aug 18:20
  Gimp Perspective Clone Tool David Gowers 03 Aug 18:54
   Gimp Perspective Clone Tool Pedro Alonso 11 Aug 00:47
    Gimp Perspective Clone Tool David Gowers 11 Aug 08:07
     Gimp Perspective Clone Tool Sven Neumann 11 Aug 08:18
    Gimp Perspective Clone Tool David Gowers 11 Aug 10:24
     Gimp Perspective Clone Tool Pedro Alonso 11 Aug 19:21
      Gimp Perspective Clone Tool David Gowers 12 Aug 06:04
       Gimp Perspective Clone Tool David Gowers 12 Aug 16:19
595e35640608011626w64b49be6... 07 Oct 20:24
  Gimp Perspective Clone Tool Pedro Alonso 02 Aug 01:36
   Gimp Perspective Clone Tool Pedro Alonso 02 Aug 21:04
   Gimp Perspective Clone Tool David Gowers 03 Aug 02:32
23f4e3390608102354g5e29162f... 07 Oct 20:24
  Fwd: Gimp Perspective Clone Tool David Gowers 11 Aug 08:55
Pedro Alonso
2006-08-02 01:36:07 UTC (over 17 years ago)

Gimp Perspective Clone Tool

Hi,

I am developing Gimp Perspective Clone Tool in the context of SOC. Currently the status of the project is:

- Paint Core ( /app/paint/gimpclonevanishing.c ) works fine but anti-aliasing is still not developed. Transform matrix is set in the code,
so by now it only works with the test_image that I have also included in the zipped patch.

Patch: http://www.pedroalonso.es/soc/PatchGimpCloneVanishing.zip Plot 1: http://www.pedroalonso.es/soc/persp.png Plot 2: http://www.pedroalonso.es/soc/persp2.png

- The file where all the stuff is developed is /app/paint/gimpclonevanishing.c the other ones are the same that for clone tool by now.

Source Code in html: http://www.pedroalonso.es/soc/gimpclonevanishing.html

- Now I have to develop a gui so the user may define the perspective plane in a similar way that they do via perspective tool. Using GimpTransformTool. I don't know how to do that :S

- Another thing that also would be fine is that when you choose a brush instead you see a brush outline while you are not painting see a preview. I don't know if is possible to do that.

The goal of that patch is to be included in version 2.6 of gimp, but I encourage you to test it and give some feedback ;)

Thanks, Pedro

Pedro Alonso
2006-08-02 21:04:27 UTC (over 17 years ago)

Gimp Perspective Clone Tool

Hi,

Linear interpolation is now implemented. You can see some plots:

http://pedroalonso.es/soc/persp_antialias.png http://pedroalonso.es/soc/persp_antialias2.png http://pedroalonso.es/soc/persp_antialias3.png

The patch and the source code in html are also updated again to the server. The links to them are the same.

Thanks, Pedro

On 8/2/06, Pedro Alonso wrote:

Hi,

I am developing Gimp Perspective Clone Tool in the context of SOC. Currently the status of the project is:

- Paint Core ( /app/paint/gimpclonevanishing.c ) works fine but anti-aliasing is still not developed. Transform matrix is set in the code,
so by now it only works with the test_image that I have also included in the zipped patch.

Patch: http://www.pedroalonso.es/soc/PatchGimpCloneVanishing.zip Plot 1: http://www.pedroalonso.es/soc/persp.png Plot 2: http://www.pedroalonso.es/soc/persp2.png

- The file where all the stuff is developed is /app/paint/gimpclonevanishing.c the other ones are the same that for clone tool by now.

Source Code in html: http://www.pedroalonso.es/soc/gimpclonevanishing.html

- Now I have to develop a gui so the user may define the perspective plane in a similar way that they do via perspective tool. Using GimpTransformTool. I don't know how to do that :S

- Another thing that also would be fine is that when you choose a brush instead you see a brush outline while you are not painting see a preview. I don't know if is possible to do that.

The goal of that patch is to be included in version 2.6 of gimp, but I encourage you to test it and give some feedback ;)

Thanks, Pedro

David Gowers
2006-08-03 02:32:10 UTC (over 17 years ago)

Gimp Perspective Clone Tool

On 8/2/06, Pedro Alonso wrote:

Hi,

I am developing Gimp Perspective Clone Tool in the context of SOC.

- Now I have to develop a gui so the user may define the perspective plane in a similar way that they do via perspective tool. Using GimpTransformTool. I don't know how to do that :S

- Another thing that also would be fine is that when you choose a brush instead you see a brush outline while you are not painting see a preview. I don't know if is possible to do that.

I'd like this, but I think it's unrelated to vanishingpoint cloning.. I think it's been discussed before and it was concluded that it would be too slow/tricky until GEGL ws in use.

The goal of that patch is to be included in version 2.6 of gimp, but I

encourage you to test it and give some feedback ;)

Actually, I still haven't tried it -- mainly because of the UI issue. Initially, I would think that you could just have the user CTRL+click and drag to set
the perspective. That would not handle many cases, but it would be enough to test with.
Sadly, I don't understand enough of the way the UI works to be able to suggest a way to implement that.

.. looking around, the right thing to investigate might be gimpdrawtool. you have, for example, gimp_draw_tool_draw_line, gimp_draw_tool_draw_handle.

I got my ideas from tools/gimpvectortool.c:

The user-interaction seems to be in gimp_vector_tool_button_press,
gimp_vector_tool_button_release,
gimp_vector_tool_motion,
gimp_vector_tool_key_press,
gimp_vector_tool_modifier_key,
gimp_vector_tool_oper_update (not sure exactly how this one is supposed to work.)

and the drawing of any tool-specific things (like the source cursor for the clone tool) is in gimp_vector_tool_draw. Most of those functions are pretty clear. I hope that helps.

Dave Neary
2006-08-03 18:20:20 UTC (over 17 years ago)

Gimp Perspective Clone Tool

Hi Pedro,

Pedro Alonso said:

I am developing Gimp Perspective Clone Tool in the context of SOC. Currently the status of the project is:

- Now I have to develop a gui so the user may define the perspective plane in a similar way that they do via perspective tool. Using GimpTransformTool. I don't know how to do that :S

How about a GUI similar to the SIOX tool, with a first step where you set the perspective, and a second where you paint? Workflow would go like this:

1. choose perspective tool 2. In image, clicking brings up a perspective tool wireframe (not preview). I manipulate the wireframe as I would for the perspective tool. To finish, I double-click the image. 3. The wireframe stays on the image (perhaps there needs to be a reset button in the tool options to allow me to reset and choose another perspective?) - this probably isn't necessary, but might be useful. 4. I choose a source as with the clone tool (Ctrl-click) 5. I draw (the active brush is used), and the source I take from the image is transformed using the transformation matrix of the transform tool.

This seems like a pretty tricky interface to use, but it's an idea - and it sounds like there's lots of opportunity to reuse existing functionality to get your transformation matrix.

I remember that Cameron Barton was asking for similar functionality to this some years ago. Cam, are you still around? Want to give some interface ideas?

Cheers,
Dave.

David Gowers
2006-08-03 18:54:22 UTC (over 17 years ago)

Gimp Perspective Clone Tool

On 8/4/06, Dave Neary wrote:

2. In image, clicking brings up a perspective tool wireframe (not preview). I manipulate the wireframe as I would for the perspective tool. To finish, I double-click the image.

The rest that you described sounds fine.

Single-clicking near the middle of the perspective plane to finish defining the plane would probably be better than doubleclicking -- since perspective-clone is a paint tool, being able to use it quickly is important.

Pedro Alonso
2006-08-11 00:47:04 UTC (over 17 years ago)

Gimp Perspective Clone Tool

Hi,

Currently the tool has a UI. The source code is in the cvs branch soc-2006-perspective-clone so you can build and try it :)

I have also copy & paste a little tutorial (from the current gimp documentation) and is in www.pedroalonso.es/soc

By other way some things in the tool that have to be fixed are:

- When you define the perspective plane, changes the mode to clone paint, and go back to change the perspective plane mode, it doesn't works.

- When you are using the tool, defines the plane, uses another tool and go back to perspective clone it doesn't remind the plane you defined before.

- As Dave Neary told before would be fine to have a button to reset the perspective plane.

regards, Pedro

On 8/3/06, David Gowers wrote:

On 8/4/06, Dave Neary wrote:

2. In image, clicking brings up a perspective tool wireframe (not preview). I manipulate the wireframe as I would for the perspective tool. To finish, I double-click the image.

The rest that you described sounds fine.

Single-clicking near the middle of the perspective plane to finish defining the plane would probably be better than doubleclicking -- since perspective-clone is a paint tool, being able to use it quickly is important.

David Gowers
2006-08-11 08:07:18 UTC (over 17 years ago)

Gimp Perspective Clone Tool

This looks wonderful.
Some questions while I compile:

* How does it handle patterns? An example would be useful. This reminds me that I need to fix the Clone tool to allow setting the source offset for patterns.

* Does CTRL actually govern the 'set plane'/'clone' toggle or is that just a copy+pasted bit of text?

* Is keyboard control implemented? Can I press up/down to rotate the plane on the 'z' axis, or left/right to rotate it in the 'x' axis? (this idea is based on the UI of DeluxePaint, which had an extremely good UI including for this kind of thing.)
This is probably one of the best ways of doing fine adjustments.

* Why is the 'hard edge' toggle (from the clone tool) missing? Usually hard edge is my preference.

* Being able to turn off interpolation is important to me. Is this currently possible?

Sven Neumann
2006-08-11 08:18:02 UTC (over 17 years ago)

Gimp Perspective Clone Tool

Hi,

On Fri, 2006-08-11 at 15:37 +0930, David Gowers wrote:

* Why is the 'hard edge' toggle (from the clone tool) missing? Usually hard edge is my preference.

Do we really need this toggle at all? You should get similar results if you used a hard brush.

* Being able to turn off interpolation is important to me. Is this currently possible?

Why would you want to turn off interpolation?

I am asking these questions because I would like to get a better idea of how people are working with GIMP. This will help us to identify problems and to find options that could be removed in order to reduce clutter.

Sven

David Gowers
2006-08-11 08:55:53 UTC (over 17 years ago)

Fwd: Gimp Perspective Clone Tool

.. accidentally replied to only Sven. Message follows, I believe it's relevant.

---------- Forwarded message ---------- From: David Gowers
Date: Aug 11, 2006 4:24 PM
Subject: Re: [Gimp-developer] Gimp Perspective Clone Tool To: Sven Neumann

On 8/11/06, Sven Neumann wrote:

Hi,

On Fri, 2006-08-11 at 15:37 +0930, David Gowers wrote:

* Why is the 'hard edge' toggle (from the clone tool) missing? Usually hard edge is my preference.

Do we really need this toggle at all? You should get similar results if you used a hard brush.

Only if I make a custom one.. With VBRs set to hardness == 1.0, it is still not fully hard, there are grey pixels in the mask as well as black and white.
Also, Subsampling would still make a mess; when I'm working at a pixel level, subsampling just gets in the way. With 'hard edge', I don't get a mess because there are no 'half-pixels' plotted; If i draw a yellow shape on a blue shape, I get two colors (yellow and blue), rather than (yellow,blue, and several intermediate colors) which makes it very hard to change colors of an area well.

Why would you want to turn off interpolation?

I am asking these questions because I would like to get a better idea of how people are working with GIMP. This will help us to identify problems and to find options that could be removed in order to reduce clutter.

Because clarity is important, and interpolation definitely reduces definition.
When you have sharp edges on everything, it's much easier to modify colors and select regions.. Think of cel-shaded art, typically drawn very big and then scaled down to display size.

In more general terms, I work on both large (CG) and small (pixel art/sprites) sized images, and in both cases I want to be able to control exactly which pixels are changed. Both subsampling and interpolation detract from that.

David Gowers
2006-08-11 10:24:02 UTC (over 17 years ago)

Gimp Perspective Clone Tool

On 8/11/06, Pedro Alonso wrote:

Hi,

By other way some things in the tool that have to be fixed are:

- When you define the perspective plane, changes the mode to clone paint, and go back to change the perspective plane mode, it doesn't works.

Actually, it does work -- you just can't see it. Switch back to clone mode and you'll see the modified plane. BTW, good work on the interface, it's really intuitive.
My comments on the use of a keyboard interface are still valid, though. And being able to see the mouse pointer while setting the perspective plane would also help a lot.

My comment about interpolation I still agree with; For some of my test images interpolation was appropriate, others it blurred unacceptably, so I still think the option to disable it should be provided.

The initial coordinates of the plane corners should probably be at the corners of the visible area, rather than the corners of the entire image.. I was confused by this initially.

Pedro Alonso
2006-08-11 19:21:18 UTC (over 17 years ago)

Gimp Perspective Clone Tool

Hi,

- When you define the perspective plane, changes the mode to clone paint, and go back to change the perspective plane mode, it doesn't works.

Actually, it does work -- you just can't see it. Switch back to clone mode and you'll see the modified plane. BTW, good work on the interface, it's really intuitive.

Thanks, I still have to check it..

My comments on the use of a keyboard interface are still valid, though. And being able to see the mouse pointer while setting the perspective plane would also help a lot.

The use a keyboard interface is also a good idea, but still to be done.. :) About to see the mouse pointer while setting the perspective plane.. currently the cursors are used in the same way as in perspective tool, so your purpose would also be for that tool.. I don't really find it necessary...

My comment about interpolation I still agree with; For some of my test images interpolation was appropriate, others it blurred unacceptably, so I still think the option to disable it should be provided.

I think that disable linear interpolation would do the tool unusable, here you can see some examples:

http://pedroalonso.es/soc/persp.png http://pedroalonso.es/soc/persp2.png

And similar with interpolation:

http://pedroalonso.es/soc/persp_antialias.png http://pedroalonso.es/soc/persp_antialias2.png http://pedroalonso.es/soc/persp_antialias3.png

Can you provide some images where interpolation doesn't works fine? so if this option is needed I can add it to the UI

The initial coordinates of the plane corners should probably be at the corners of the visible area, rather than the corners of the entire image.. I was confused by this initially.

Ok, thinking about it.. hehe.

Btw, I have added the same options for paint that are used in clone tool, and have moved the radio buttons where you choose if you are setting the perspective plane or cloning to the top of the options UI.

kind regards, Pedro

David Gowers
2006-08-12 06:04:21 UTC (over 17 years ago)

Gimp Perspective Clone Tool

On 8/11/06, Pedro Alonso wrote:

The use a keyboard interface is also a good idea, but still to be done.. :)
About to see the mouse pointer while setting the perspective plane.. currently the cursors are used in the same way as in perspective tool,

They aren't! I can see my mouse cursor in the perspective tool! Perhaps my cursor preferences would help you to notice this.. I think i have the cursor set to fancy rendering mode, and to only show the crosshairs.

I think that disable linear interpolation would do the tool unusable,

here you can see some examples:

http://pedroalonso.es/soc/persp.png http://pedroalonso.es/soc/persp2.png

That's expected and desired behaviour. As I said, subsampling and interpolation have the same problem for me, they add colors; I know that many people don't care about incidentally adding colors, but having direct control over the colors is important for what I do. The rough edges show me where I should touch up manually because the computer can't decide well (these same areas need touchup regardless of whether interpolation is used or not; interpolation reduces definition, no-interpolation reduces smoothness.) If I am forced to use interpolation with a tool, I must adjust colors after each usage of it. Mostly this is unrewarding and tedious; I usually get better results quicker by manual cleanup.

And similar with interpolation:

http://pedroalonso.es/soc/persp_antialias.png http://pedroalonso.es/soc/persp_antialias2.png http://pedroalonso.es/soc/persp_antialias3.png

Can you provide some images where interpolation doesn't works fine? so

if this option is needed I can add it to the UI

Sure, when I get my stuff migrated from my old HD completely. Later today, perhaps (depending on how much recompilation is needed)

Actually... For your tool to work similarly to the clone tool and perspective tool, I just realized it MUST be able to disable interpolation. Otherwise it doesn't work on INDEXED images (have you tried it on an indexed image yet?)

Btw, I have added the same options for paint that are used in clone tool, and have moved the radio buttons where you choose if you are setting the perspective plane or cloning to the top of the options UI.

Good, I'll check that out at the same time.

David Gowers
2006-08-12 16:19:33 UTC (over 17 years ago)

Gimp Perspective Clone Tool

On 8/12/06, David Gowers wrote:

Actually... For your tool to work similarly to the clone tool and perspective tool, I just realized it MUST be able to disable interpolation. Otherwise it doesn't work on INDEXED images (have you tried it on an indexed image yet?)

I just tried it on an indexed image.. It generally looks fairly messy (where interpolation occurs, off-colors (somewhat mismatched -- like the right brightness but wrong hue, etc..) usually appear) Though, after messing around for a while, I admit I have little idea how to effectively employ the perspective clone tool.

I noticed that the alpha channel is not handled yet (meaning that cloning 'empty' pixels results in arbitrary colors appearing)

Btw, I have added the same options for paint that are used in clone

tool,

That looks good; consider taking out the 'pattern' vs 'image' choice if you can, unless you plan on supporting perspective cloning of patterns.