You are here

Probably a trivial question on plugin development (Comic Studio style rulers)

I'm considering developing my own plugin for GIMP and below I list 6 points. I want to know if it is doable as a plugin.

I have experience coding, so coding won't be the problem here. I've spent some time looking through the API documentation I found at some site, but what I want to do is so unusual that I can't find any information about if it is even possible to do as a plugin. I know it is NOT possible to do with the Photoshop plugin SDK.

What I'm looking to make is a particular plugin that allows an different way of working with images. It is a method that CANNOT be done in Photoshop with ANY plugins, and it can most likely not be done in GIMP (unless there is some plugin I don't know of).

The intent of the plugin is to imitate the ruler system as it works in Comic Studio. Comic Studio has an AMAZING system of rulers that takes control over cursor and brush position without affecting the pen pressure (if you're using a tablet).

1: Basic rulers
You can draw a ruler on the "ruler layer" and it will create a geometrical shape that can be moved around independently of the underlying image. When you draw near the ruler, the brush will snap to the outline of it. This means that you can create a circular ruler and then if you draw close to it, the brush will snap to the circle.

2: Straight lines rulers
You can create a ruler that locks brush movement so that once a brush it is placed it will be locked in one particular direction. This is amazing for creating a bunch of parallell lines in the same direction quickly.

3: Symmetry guides
When you draw on one half of the screen another brush will simultaneously draw a mirror reflection on the other half of it. You can extend these so that they draw repeated patterns.

4: Single point ruler
You define a central point somewhere in the image and wherever you draw the cursor will be locked in a line between the point you defined and the point where you placed the brush.

5: Concentric circles ruler
You define a central point somewhere in the image and wherever you draw the cursor will be locked in a circle with the distance between the original pen position and the central point defining the radius. You can use this to create multiple circles centered around

6: Perspective ruler
This combines up to three single point rulers and one or two straight line rulers with some simple maths to create the ultimate tool in perspective drawing. Yes. Comic Studio is worth the money for the freaking perspective ruler alone.

I need to know if it is possible to write a GIMP plugin to cover those points. It is also important that the plugin can display graphical data on top of the image, to show ruler lines. This is especially important for the perspective ruler.

I understand what you wish also Manga studio (and partially PD pro) have similar handy options and would be nice in gimp too

but looks much more complicated then a plugin, i believe would require modification of the brush engine and maybe of some other gimp innards

Did you had a look to MyPaint ?
It doesn't include yet what you ask but since is focused on sketch and painting, what you wish will fit more in the product vision and anyway may be more easy to implement there

I would really like see what you propose in MyPaint

i would love even in Gimp but again i believe would be much more difficult with gimp...
For technicals reason and also because would not fit in the gimp "product vision" (not a problem for a third party plugin but again i think you would need to modify also the gimp code
and if the changes would be not accepted (as example to keep the source code as simple and compact possible ) then you would have to mantain your own version

With mypaint would be easier and for sure will be IN the product vision

To answer your main question, the features you propose are not possible to implement as a plug-in -- you would need to implement them as a new "Tool". This is because plug-ins do not interact with image windows; i.e., a plug-in can not monitor mouse events that take place outside the plug-in's dialog window (such as occurs when "painting" on the canvas).

You could implement your features within a preview inside the plug-in's dialog, in the manner of the Iwarp filter; however, this is not a very elegant solution and your features would be better implemented as a GIMP Tool.

Alexandre Proukadine has written a nice tutorial about creating a new Tool but unfortunately I do not currently have access to the link (I have it bookmarked on a different computer). If you can find it, I would recommend it as a starting point for your project. You might further investigate the development efforts that have attempted to implement the Iwarp filter as an on-canvas Tool and also the "cage transformation" project.

Also, if you qualify, you might consider applying for Google Summer Of Code sponsorship for your project.

Per the specifics of your proposal, the symmetry stuff would seem fairly trivial to implement, though you may encounter some resistance in convincing the GIMP developers of its suitability for GIMP's product vision (of course, being Free Software you are welcome to implement your customizations without approval from, or incorporation into, the official GIMP project). GIMP developer Alexia Death appears to be the expert on GIMP's painting engine and might be able to assist with information on mouse/stylus inputs and brush dynamics.

The other points of your proposal offer (to my view) a completely separate functionality and should probably be pursued as an independent project. Aside from the fact that I don't understand what is meant by point #4 (perhaps owing to my never having used Comic Studio), I would say they all fall under the category of "drawing constraints" and this is a topic which to me is very intriguing (and to my mind inarguably consistent with GIMP's product view).

Michael Terry of the University of Waterloo (ONT, Canada) has led a project along these lines, calling the implementation "kinematic templates", though it was done as a standalone program and never incorporated into GIMP. Nonetheless, it would be well worth reviewing that project.

My own thoughts on the topic are that the constraints ("kinematic templates") could possibly be implemented as topological maps (saved in a GIMP channel) with the brush being "coerced" to following the topological lines. I made a post in more detail on GIMPchat.com.

I am not sure whether my proposed approach is feasible -- it would be rather computation intensive, perhaps excessively so -- but if it were, the result would be an intuitive, non-intrusive addition to mouse interaction while painting. Nonetheless, if you are interested in pursuing such functionality, I would offer whatever assistance I could.

Thanks for your replies.

I will clarify point 4 as I realize now it is rather confusingly written and I realize trying to explain this ruler behavior in text is quite difficult.

First you define a point somewhere on the picture (or outside of it). Now if you try to draw anywhere on the picture, Comic Studio will prevent you from doing anything other than drawing straight lines, and each line will intersect the point you just defined.

I wish I had a good picture to demonstrate this with. The best I could find is this:

http://manga.smithmicro.com/tutorials/img/1837/3-6107-600x900.jpg

Something like that is trivially simple to draw using this effect.

The kinematic templates thing is very interesting. It is close to what I want to do except my intent is not to define regions within which these rulers apply, rather the ruler effects apply globally and you "deactivate" a ruler when you don't want it to snap.

Ideally the application should have something akin to Photoshop's layer view, except each layer would represent a ruler. It should be possible to activate and deactivate any rulers you've created.

I was looking to do it in photoshop first, but that SDK is too limited. It seems to be quite a challenge to implement even in GIMP.

As for the symmetry ruler, it is not at all necessary. The perspective ruler is really the main attraction.

Subscribe to Comments for "Probably a trivial question on plugin development (Comic Studio style rulers)"