Re: [Gimp-developer] RE : Drawable copying / manipulation in plugin development

2010-01-09 Thread Sven Neumann
On Fri, 2010-01-08 at 23:04 -0500, François Gingras wrote:
 Thanks, I actually hadn't realized that the data wasn't sent to the
 plug-in. Is there any way for a plug-in to use a function similar to
 gimp_drawable_transform_matrix_default() with data the it has access
 to?
 
 They say images are worth a thousand words... So what I'm basically
 trying to do is turn this image:
 
 http://mat.ulaval.ca/~fgingras/misc/1.png
 
 into this one:
 
 http://mat.ulaval.ca/~fgingras/misc/2.png

But for that you don't need to have the data in the plug-in. This is a
simple task that involves nothing but operations that are already
available and accessible through the PDB. I would suggest that you use a
GIMP Python or Script-Fu script to perform this task. But of course you
can also do this in C if you prefer that.


Sven


___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] RE : Drawable copying / manipulation in plugin development

2010-01-09 Thread Liam R E Quin
On Fri, 2010-01-08 at 23:04 -0500, François Gingras wrote:

 They say images are worth a thousand words... So what I'm basically
 trying to do is turn this image:
 
 http://mat.ulaval.ca/~fgingras/misc/1.png
 
 into this one:
 
 http://mat.ulaval.ca/~fgingras/misc/2.png

Do you have to do it on hundreds of images? A simple script
will suffice and you could use gimp in batch mode.  Or even
use Imagemagick to do scaling.  In gimp in script-fu you'd
use gimp-drawable-transform-scale-default, if I understand
what you are trying to do.

If the images are coming from a font you could also have the
font scaled before rendering it -- e.g. use fontforge, or just
assign a new fontmatrix in fontconfig (assuming Linux).

(if you're doing it for a Web page, note that most of the
newest Web browsers can do transformations too now, using CSS)

Hope this helps.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org

___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


[Gimp-developer] RE : Drawable copying / manipulation in plugin development

2010-01-08 Thread François Gingras
Thanks, I actually hadn't realized that the data wasn't sent to the plug-in. Is 
there any way for a plug-in to use a function similar to 
gimp_drawable_transform_matrix_default() with data the it has access to?

They say images are worth a thousand words... So what I'm basically trying to 
do is turn this image:

http://mat.ulaval.ca/~fgingras/misc/1.png

into this one:

http://mat.ulaval.ca/~fgingras/misc/2.png

Thanks again!

François


De : Sven Neumann [s...@gimp.org]
Date d'envoi : 8 janvier 2010 17:46
À : François Gingras
Cc : gimp-developer@lists.XCF.Berkeley.EDU
Objet : Re: [Gimp-developer] Drawable copying / manipulation in plugin 
development

On Fri, 2010-01-08 at 16:37 -0500, François Gingras wrote:
 Greetings,

 Sorry if this sounds very newbie-ish; I'm somehow new to GIMP plugin
 development. Is there any quick way to copy a drawable in memory, in
 order to manipulate it, and then manipulate the original again?
 Basically, what I'm trying to do is transforming an image in a few
 different ways (every time using the original image) using
 gimp_drawable_transform_matrix_default, keeping results in memory, and
 then putting all these results in one image, which would be sent back
 to the core.

I don't quite understand what you are up to. All the data is kept in the
core if you use gimp_drawable_transform_matrix_default(). You just tell
the core to transform the drawable. No data is actually sent to the
plug-in.

I assume that the drawable your plug-in is working with, is actually a
layer. Then the easiest way to create a copy of the drawable is to
duplicate that layer.


Sven


___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer