Re: [Gimp-user] removing layer area

2010-05-10 Thread Pere Pujal i Carabantes
El dl 10 de 05 de 2010 a les 08:02 +0200, en/na bob va escriure:
> Hi all.
> 
> I'm trying to edit an jpg image I've downloaded from the net.
> This image:
> 
> http://creativenerds.co.uk/wp-content/uploads/2009/04/twitter-icos.jpg
> 
> As you can see, the image has a white background.
> 
> I want to isolate one of the illustrations and remove the white background.
> 
> First I use the scalpal tool to isolate one of the illustrations. Then I use
> either the select tool or the erasor to remove the white. Instead of getting
> transparent area as a result, I get a grey.
> (What is happening here)
> 
> To get around this, I first save the image as a png, then give the image a
> background layer with a random colour, save the image as an xcf and close the
> image. Then I open the xcf. 
> Again, I try to erase the white in order to get a transparent area. Again, I
> get an grey as a result.
> 
> Obviously, I'm running into the boundaries of my understanding of image
> formats here.
> 
> I'd love to know why I'm getting these results.

JPG don't has transparencies, so GIMP opens them withouth alpha channel.

> 
> I'd also like to know how I can remove the white area and get transaparency
> without closing and re-opening the image.
> 

Add alpha channel as suggested, then use the magic wand to select the
wite then edit->cut and you are done.

But if you want more quality, then zoom to 800 or more, look at the
white in the edges and continue adding a layer mask (transfering the
alpha channel already created, then carefully paint the edges of the
object in the main layer with the same color as the neighbour pixels, so
the wite don't show in the edges.

Hope this helps.
Pere

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


Re: [Gimp-user] image resize

2010-03-14 Thread Pere Pujal i Carabantes
El dg 14 de 03 de 2010 a les 20:27 +0100, en/na Phil va escriure:
> >Off-list reply
> >
> >* Phil  [03-14-10 13:52]:
> >I have attached the image.  If you wish to print a larger size, you
may
> >open the image in gimp and increase the print size under "Image", or
I
> >will do it for you.  
> >
> >guk luk,
> >
> 
> Thank you for the help, but where do I find the image?  Sorry for
being an
> idiot 
> 
Nopes, you are NOT an idiot, the problem is that gimpuser.com is
deleting the attachments in the messages it receives and that it uses
his own email address to connect to the gimp user mailing list, so any
private replies goes to his public web.

I suggest you use a real mail program to acces this mail list instead of
a forum<>mail<>forum web.

Pere


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


Re: [Gimp-user] getting text into a gimp photo?

2010-03-07 Thread Pere Pujal i Carabantes
El dg 07 de 03 de 2010 a les 17:25 -0500, en/na Helen va escriure:
> I have a document in OO (a poem), and I'd like to get it into a gimp
> picture.
> 
> I can't think of any way to do that.  I can take a screen shot but the
> document
> is longer than will fit on a screen (it's about a screen and a half)
> and I want it to
> look like it's part of the picture (background is the picture of an
> open, blank book).
> 
> I could retype it into a Gimp layer, but, aside from the time
> involved, Gimp
> doesn't have the typeface I want.
> 

In OO print to a file (postscript or pdf), then open it in GIMP.

HTH Pere

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


[Gimp-user] How I´ve losed a image.

2009-12-19 Thread Pere Pujal i Carabantes
Hi all!

Linux Debian unstable + The GIMP 2.6.5 editing an image of about
4000x3000 pixels creating and destroying layers trying to find the best
sets for a effect.
At one point the OS was become unresponsive and at the bottom bar of
GIMP, the displayed size showed more than 1,4GB. Then I´ve typed CTRL+S
to save and after waiting about 15 minutes I´ve pressed the reset
button.

After restarting, the file had 0 size. I had to recover it from a
backup, losing all the work I did and saved in the file previously in
the morning.(*)

The questions are:

How can I control the memory usage of The GIMP?
   I supose that tweaking the different settings in environmet
prefences, but I am not sure how to count it, should I sum max mem for
undo to max mem for cache in order to get the maximum of memory I am
allowing to The GIMP?

Are there other settings affecting the memory usage?


Will a feature request of "indirect saving" be taked in account?, Say
save to a newtmp file,
then copy/move the main file to oldtmp file,
then move newtmp file to main file
then remove oldtmp file.
This should ensure that a system crash in the middle of a save operation
will be recoverable.


And finally, will a feature request of auto-backup be taked in account? 




(*) This is not exactly true, as I´ve said, I was trying and
_discarding_ settings and procedures to get a desired effect, so after
recovering the file from the backup I was able to get the final result
in about 30 minutes of work :)


Yours
Pere

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


Re: [Gimp-user] Actions on multiple layers at the same time

2009-12-10 Thread Pere Pujal i Carabantes
El dj 10 de 12 de 2009 a les 20:31 +0100, en/na Deniz Dogan va escriure:
> Is there any way to duplicate multiple layers in one action?
> Is there any way to toggle visibility of multiple layers in one action?

Layer groups?

http://www.gimpstuff.org/content/show.php/Layer+groups?content=83137
http://registry.gimp.org/node/16563


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


Re: [Gimp-user] Installing 2.6.7 in Ubuntu

2009-08-31 Thread Pere Pujal i Carabantes
El dg 30 de 08 de 2009 a les 02:56 +0200, en/na Carusoswi va escriure:
> Ok, so, I downloaded Gimp 2.6.7 from GetDeb along with the library files and
> the data files.  When I try to run the package installer, I get an error that
> there is a dependency problem with the lib files.
> 
Does getdeb provide access to apt throut sources.list?
If so, the best way is to modify your /etc/apt/sources.list adding the
getdeb repository.

If not, try installing first the lib and data debs and then the gimp
one.

My two cents
Pere

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


Re: [Gimp-user] how to mingle the edges of picture clips?

2009-03-25 Thread Pere Pujal i Carabantes
El dc 25 de 03 de 2009 a les 15:24 -0400, en/na Don va escriure:
> I am very very new to Gimp and graphic design.  I think this is very
> basic, but don't know the professional terminology.
> 
> Please take a look at the following picture, 
> 
> http://www.peteconstant.com/assets/images/Web-Banner-Raw3-Dan1.jpg
> 
> You can see that different pictures are mixed into this web banner,
> and they don't have a clear edge between them, in other words, where
> they get joined, the color gets blurred.  I am sure this is easy and
> very very basic, but don't know how to google out since I don't know
> what this technique is called (I think this is an area which google
> needs to work on, i.e., how do I google if I don't know what a
> concept/entity is called).


Not tested:

Supose you have image_left and image_right
Create a new image same height, double width.
add two layers to it, set color to transparency.
copy/paste left image to the left of one layer.
copy/paste right image to the right of the other layer, overlaping a
small portion.
add layer mask to both layers
fill the layer mask of each layer with:
white where it has the image, black where there is the image in the
other layer, gradient from white to black where two images overlaps.

Hope this helps
Pere

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


Re: [Gimp-user] GIMP needs to close (!)

2009-03-13 Thread Pere Pujal i Carabantes
El dv 13 de 03 de 2009 a les 01:32 +0100, en/na aether va escriure:

> 
> At this point, I think my best bet is to somehow reach GIMP, but I don't yet
> see any way of doing that.

So you just have probed that "at least" you have overlooked two pages
without understanding what they mean:
www.gimp.org that has links with info about mail lists and IRC

http://www.gimpusers.com/forums/gimp-user/ which explicitely says:
This forum is connected to the gimp-user mailing list.

So, yes, you have reached the gimp developers, but still you have not
provided any valuable info that helps them to help you.

You have been asked about the console output for example, maybe you
don't understand all this garbage, but hopefully someone else will
understand it, so please, copy it (all it, not just the end) to a place
on the web and put the link here. Of course after inspecting that it
doesn't contains sensible information.

Can I suggest this read?
http://www.catb.org/~esr/faqs/smart-questions.html

Hope this helps
Pere

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


[Gimp-user] Converting a color into another color.

2008-09-26 Thread Pere Pujal i Carabantes
Hi all!

I have two photos of the same subject: one blured taken withouth flash,
the other taken with flash is clean but has a reflected color from the
background mixed with the subject colors.

My idea is to translate the colors on the clean photo to the colors on
the blured one.

How do you suggest I can handle this?
So far I've tryed colortoalpha, that does some sort of color conversion,
but I am unable to find the right color to start with.

Any hints will be appreciated.
Thanks
Pere

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


Re: [Gimp-user] Plug-in to set the visibility of a group of layers

2008-06-15 Thread Pere Pujal i Carabantes
El dv 13 de 06 de 2008 a les 09:33 +0200, en/na Pere Pujal i Carabantes
va escriure:

> 
> It laks preview, but does the basic and most important thing.

No, it don't lacks preview, it laks agility.

Here is a diff to your script that adds a controller dialog.
http://fornol.no-ip.org/linux/gimp/diffto_layer_groups.py

The dialog shows the groups you have made to an image and allows to
change between them.
The dialog don't close until you close it, and the results are shown as
soon as you click on the names of the groups.
Please, feel free to adopt or reject the patch and enhance it.

Hope this helps, at least it works for me :)
Thanks
Pere

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


Re: [Gimp-user] Plug-in to set the visibility of a group of layers

2008-06-13 Thread Pere Pujal i Carabantes
Hi Joao!

El dj 12 de 06 de 2008 a les 00:01 -0300, en/na Joao S. O. Bueno va
escriure:
> Hi again,
> 
> I actually updated the plug-in, as working with visibility would be 
> nice as wella s working with the linked states.
> 

Very nice tool, thanks! :)

It laks preview, but does the basic and most important thing.
Is it possible to add preview in a python-fu plugin or is better to 
develop a plugin in C ?


Yours
Pere

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


[Gimp-user] set the visibility of a group of layers

2008-06-10 Thread Pere Pujal i Carabantes
Hi all!

Many times I have to set the visibility of a group of layers, for
example to test the results from a combination of them against another
combination of layers.

Is there some plugin that allows to set some groups of layers and then
change their visibility at once?

Thanks
Pere.

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


Re: [Gimp-user] Redo paints after creating a new layer

2008-06-10 Thread Pere Pujal i Carabantes
El dt 10 de 06 de 2008 a les 09:36 +0200, en/na Johan Vromans va
escriure:
> Hi,
> 
> When on vacation I often do this:
> 
> - import an image of a map (download, digital photo)
> - enhance it until satisfactory
> - create a new layer
> - place a series of dots denoting a route
> 
> I often discover after placing a whole lot of dots that I forgot to
> create the new layer first. Using undo, I go back to the pristine
> state. I can then redo the history to get the dots back. However, I
> cannot redo the paints anymore after creating a layer.
> 
> Is there a way to accomplish this?

You can try this:

starting from the drawed image:
redo all up to have all dots drawed.
select all.
copy
paste as new image
undo up to pristine state before drawing dots but after the
enhancements.
select all (you will not be able anymore to redo)
copy

in the new image:
duplicate the layer (as this you have a backup of the dots)
hide the duplicate
add a new layer
import the pristine state into it -> paste
duplicate it and hide the duplicate (you will need later)
raise the visible drawed layer to top.
set mode in the drawed layer to 
   divide if the dots are not white or black.
   else to grain extract.
flat visible layers. (drawed and pristine)
color to alpha (white if there was divide or grey if grain extract)
if grain extract select by color transparent, invert selection and fill
the dots with original color
set the duplicate of pristine layer visible and down it.



Hope this helps
Pere

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


Re: [Gimp-user] Opacity

2008-05-19 Thread Pere Pujal i Carabantes
El dg 18 de 05 de 2008 a les 23:03 -0300, en/na Lap1994 va escriure:
> Let make things more simple to understand.
> 
> If I draw a %50 opacity white pixel above one black pixel with the pencil  
> it becomes silver. But I want the pixel WHITE AND WITH %50 OF OPACITY. I  
> simply want to change the alpha when I draw and not how much the color  
> change.

Starting from one layer:

Add a new transparent layer.

Set the transparency to 50% in the tool options, not in the layer
options.

Draw on this layer the things you want, when finished, select by color
transparent on this layer (threesold 0), invert the selection.

Go to the original layer, cut, then flat the layers.



Hope this helps
Pere

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


Re: [Gimp-user] windows dancer

2008-04-15 Thread Pere Pujal i Carabantes
El dt 15 de 04 de 2008 a les 17:03 -0400, en/na Adonj Adonj va escriure:
 
> The dancers I make using only a few frames, with transparent
> backgrounds, end up with the mid-tone checks appearing along the
> contour of any part of the subject that has moved in each animated
> frame. Is there any way to keep the checks invisible along the entire
> contour of the subject?

I not fully understand you, but if the problem is that the background
color(transparent but existent) gets mixed with the foreground color on
the edges of the subject, one possible solution is to paint the
background with the colors of the edge, as this, when mixed they will be
the same.


Yours
Pere

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


Re: [Gimp-user] Setting preferences for saving png

2008-04-11 Thread Pere Pujal i Carabantes
El dv 11 de 04 de 2008 a les 12:01 +0200, en/na Torsten Neuer va
escriure:
> Hi, 
> 
> > I usually have to save transparent pixels of PNGs, but time to time
> > don't save them just to compare the difference in size.
> >
> > The problem is that default preferences get changed, and if I just save
> > instead of save as, I lose my work on the transparent parts of the
> > image.
> >
> > Is there a way to hardcode preferences for saving a png?
> 
> Not one that I know of.
> 
> But I think you should save your *work* as .xcf anyway.

Yes, I currently save as xcf.

However, the editing of transparent pixels is handled by a script
(mktpstamp) as the end step to save a png from a layer in the xcf file,
and sometimes I want to improve the results of this script, hence I am
editing directly the png file.

I've tried a call to file-png-set-defaults in the script I use, but even
if I see ~/gimp-2.4/parasiterc writed when quitting gimp, this doesn't
affect the current session.

For now, I've created a simple script that just calls file-png-save2
whith the parameters I need and use it for saving.


Thanks
Pere

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


[Gimp-user] Setting preferences for saving png

2008-04-11 Thread Pere Pujal i Carabantes
Hi all!

I usually have to save transparent pixels of PNGs, but time to time
don't save them just to compare the difference in size.

The problem is that default preferences get changed, and if I just save
instead of save as, I lose my work on the transparent parts of the
image.

Is there a way to hardcode preferences for saving a png?


Thanks
Pere

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


Re: [Gimp-user] problem with image conversion script

2008-04-07 Thread Pere Pujal i Carabantes
Hola Octavi!

El dl 07 de 04 del 2008 a les 13:27 +0200, en/na Octavi Fors va
escriure:

> Anyway, now the output "mask_gimp.ppm" file is generated. However,
> this is a greyscale one in ASCII (magic number is P2) and would like
> to output a color one in ASCII (magic number is P3).

You should insert a (gimp-image-convert-rgb image) before saving.


Salut
Pere

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


Re: [Gimp-user] problem with image conversion script

2008-04-07 Thread Pere Pujal i Carabantes
Hola Octavi!

El dg 06 de 04 del 2008 a les 19:31 +, en/na Octavi Fors va
escriure:

> I want to convert a FITS image into PPM in batch mode. 
> Grabbing code from different sites I end up to a source script version
> like this: 
> 
> (define (fits-to-ppm infile 
> outfile) 
> (let* ((image (car (file-fits-load 
> RUN-NONINTERACTIVE 
> infile 
> infile 
> ) 
> ) 
; Here you lack a ) closing (image
> (drawable (car (gimp-image-get-active-layer image
>  
> (file-ppm-save RUN-NONINTERACTIVE image drawable outfile outfile 0) 
> (gimp-image-delete image) 
> ) 
> ) 
Here you should remove the ) added before
> ) 
> 


> Thanks in advance, 
> 
> Octavi. 


Hope this helps
Pere


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


Re: [Gimp-user] Reduce the number of colors on a selection

2008-03-04 Thread Pere Pujal i Carabantes
Hi Chris, thanks for the reply.

El dg 02 de 03 del 2008 a les 15:47 -0600, en/na Chris Mohler va
escriure:
> Maybe this:
> 
> 1. Copy your selection
> 2. Edit->Paste as New
> 3. Image->Mode->Indexed
> 4. Image->Mode-RGB
> 5. Select All
> 6. Copy
> 7. Paste back into original image
> 
8 close the auxiliar image
9 confirm that I don't want to save...

To many steps, but it does just what I need, so here is a little script
implementing that, it appears at colors->index-selection:

;; Copyright 2008 by Pere Pujal i Carabantes
;; License GNU/GPL
;; Author Pere Pujal i Carabantes

(define (script-fu-index-selection
 image
 drawable
 p-type
 number-of-colors
 palette
 remove-unused
 d-type
 alpha-dither
 )

  (let*(
(dither-type (list-ref '(0 1 2 3) d-type))
(palette-type (list-ref '(0 2 3 4) p-type))
(indeximage)
)
(gimp-image-undo-group-start image)
(gimp-edit-copy drawable)
(set! indeximage (car (gimp-edit-paste-as-new)))
(gimp-image-convert-indexed indeximage  dither-type palette-type
number-of-colors alpha-dither remove-unused palette )
(gimp-image-convert-rgb indeximage)
(gimp-selection-all indeximage)
(gimp-edit-copy (car (gimp-image-get-active-layer indeximage)))
(gimp-floating-sel-anchor(car (gimp-edit-paste drawable 0)))
(gimp-image-delete indeximage)
(gimp-displays-flush)
(gimp-image-undo-group-end image)
))

(script-fu-register 
 "script-fu-index-selection"
 "/Colors/Index Selection" 
 "Reduces the colors on the current selection." 
 "Pere Pujal i Carabantes"
 "Copyright 2008"
 ""
 ""
 SF-IMAGE "Image" 0
 SF-DRAWABLE "Drawable" 0
 SF-OPTION "Palette Type" '("MAKE-PALETTE" "WEB-PALETTE" "MONO-PALETTE"
"CUSTOM-PALETTE")
 SF-ADJUSTMENT "Number of Colors (ignored unless Palette
type=MAKE-PALETTE)" '(255 2 256 1 25 0 0)
 SF-PALETTE "Palette" "Web"
 SF-TOGGLE "Remove unused (ignored if Palette type=MAKE-PALETTE)" FALSE
 SF-OPTION "Dither type" '("NO-DITHER" "Floid Steinberg" "Floid
Steinberg LowBleed" "FIXED")
 SF-TOGGLE "Alpha Dither" FALSE
 )


Hope this helps other people too.
Yours
Pere



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


Re: [Gimp-user] Reduce the number of colors on a selection

2008-03-02 Thread Pere Pujal i Carabantes
Hi vt, thanks for the reply.

El dg 02 de 03 del 2008 a les 21:12 +0200, en/na vt va escriure:
> On Sunday 02 March 2008 20:49:48 Pere Pujal i Carabantes rašė:

> > I want to reduce the number of colors like image->mode->indexed does,
> > but just on the selected parts, not in the whole image.

> 
> Right cllick on selection > Colors> Posterize

Acording to what I've find on the web(and on my tests), posterize
doesn't take the colors from the image like image->mode->indexed does.

Anyway, I'm unable to find a suitable equivalence from number of 
colors on indexed to number of levels on posterize, some doc?

Thanks
Pere

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


[Gimp-user] Reduce the number of colors on a selection

2008-03-02 Thread Pere Pujal i Carabantes
Hi all!

I want to reduce the number of colors like image->mode->indexed does,
but just on the selected parts, not in the whole image.


Any hints?

Thanks
Pere

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


[Gimp-user] Credits of Manju's flower?

2008-01-28 Thread Pere Pujal i Carabantes
Hi all!

I've done a draw based mainly on Manju's Flower (24x21)
17 properly distributed flowers in order to get a random effect.

For the license I have no problems (GNU/GPL 2+)
but Who I have to credit for it?
The Gimp Team? or is there someone who knows the author of this brush? 

Thanks
Pere

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


Re: [Gimp-user] Gimp 2.4 Script-fu problem

2008-01-03 Thread Pere Pujal i Carabantes

On Wed, 2008-01-02 at 21:09 -0200, John Coppens wrote:

> The script is supposed to add a title on a selected place, and worked
> fine under 2.2.x. Now, the text appears as a new layer, but the color
> isn't right, the layer seems blocked (cannot select another layer)while
> it's still floating, the combination mode (addition/subtraction) is not
> respected and the command in the script to flatten the image is not
> executed.
> 
> No errors appear, but something did go wrong...
> 
I guess your problem comes from the commands in the declarations
statement of the let*

[SNIP]

(let* (
(width  (car (gimp-drawable-width drawable)))

 [SNIP]

(text-x
(cond   ((= just 0) xmargin); left
((= just 1) (/ (- width fwidth) 2)) ; middle
((= just 2) (- width xmargin fwidth))   ; right
)
)

) ;; closing the declarations here.

(gimp-image-undo-group-start image)

(gimp-context-set-foreground color)
(define layer (car (gimp-text-fontname image drawable 
;;   ^^ added a define as layer has comed out of declarations.
 text-x text-y text 0 1
 fontsize POINTS fontname)
   )
)
(gimp-layer-set-mode layer
(cond   ((= mode 0) NORMAL-MODE)
((= mode 1) ADDITION-MODE)
((= mode 2) SUBTRACT-MODE)
)
)
(gimp-layer-set-opacity layer alpha)
(gimp-image-flatten image)

(gimp-image-undo-group-end image)
(gimp-displays-flush)
  ) ;; ) closing the let* here.  
)



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


Re: [Gimp-user] Alt Key

2007-12-19 Thread Pere Pujal i Carabantes

On Wed, 2007-12-19 at 21:18 +, Thomas Worthington wrote:
> On Wed, 19 Dec 2007 21:10:11 -, Daniel Hornung <[EMAIL PROTECTED]>  
> wrote:
> 
> > On Wednesday 19 December 2007, Thomas Worthington wrote:
> >> Is there any way to restore the Alt key to its old usage in 2.4? I can't
> >> drag selections anymore because it requires Alt and mouse at the same
> >> time, which is a problem on Linux.
> >
> > I'm not sure if this is possible at all, especially not if from within  
> > GIMP.
> > If someone else knows an answer, please go on.
> 
> I second that.
> 

Not sure if this is a reponse, but you can go to preferences and play
with Input controlers.

Salut
Pere

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


Re: [Gimp-user] Turn black background into white -- with fuzzy edges

2007-11-26 Thread Pere Pujal i Carabantes

El dl 26 de 11 del 2007 a les 03:59 -0500, en/na Lea Wiemann va
escriure:
> Hi,
> 
> I'd like to turn a black background into white, or transparency (in 
> which case it should look cut if displayed on a white background).  My 
> practical use case is photos of objects with black backgrounds that I'd 
> like to improve for Wikipedia.  The problem is that the boundary between 
> background and object is usually fuzzy.
> 
> I've created a pair of example images (attached): Say I start off with 
> the image fuzzy-circle.png (a gray-patterned circle on a black 
> background); what I would like to get is something like 
> fuzzy-circle-goal.png (the gray-patterned circle on a white background) 
> -- but that seems pretty hard to achieve:  If I "select by color: black" 
> and then cut the selection, the corners look either aliased/"too sharp" 
> (for high thresholds in the select-by-color tool), or they have dark 
> pixels in them (for low thresholds).  Selecting the black background, 
> growing the selection (2px), feathering it (2px), and then cutting the 
> selection *kinda* works, but it cuts off the blurry part of the object 
> boundary.
> 
> Any ideas on this one?
> 
I am doing a script that might help you. It is not specyfic to your
purpose but hope it helps.

Install mktpstamp.scm from here to your gimp-version/scripts directory
http://fornol.no-ip.org/linux/tuxpaint/scripts
Then open Gimp

Select by fuzzy select or by color black with threshold 50
Show the layers dialog.
add a layer mask  inverted from selection
You get something like fuzzy-circle-darks-pixels.png you posted
Active the image, not the mask, add an alpha channel to it.
Select by fuzzy select or by color black with threshold 50
grow the selection by the number of pixels needed to cover the dark
ones.(1 or 2)
CTRL X to delete all the selection.
You get a image that lacks the edge pixels, they will be regenerated
from the current edges when running the script.

Run mktpstamp (It appears in filters artistic in gimp 2.4.x or in
script-fu alquemy on 2.2.xx)
Uncheck Scale Create .txt file and Create .dat file
If you are confident, select a proper filename and keep Save and close.
This will make a transparent .png file
Else
Change Save and close to Don't save and keep for editing.
This will make a new image with 4 layers
A backup layer two contrast layers and the working layer.
You can then make the contrast layers visible/invisible by turn to check
if there is any weird effect.

When happy fill the green contrast layer with wite or any color you
want, flat the image and save.

If you want transparency, do a new image from the top layer(just drag
the layer to the toolbox) and save it.


More instructions to run it you can find at
http://sourceforge.net/mailarchive/forum.php?thread_name=1185622883.26911.151.camel%40hola.fou.net&forum_name=tuxpaint-devel

BTW any comments on how to improve it are welcome.


> Best wishes,
> 
>  Lea

Yours
Pere
<>___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] Previews in scripts or plugins

2007-10-19 Thread Pere Pujal i Carabantes
Hi all!

I've created a script-fu and now I am wondering if I can add a preview
for it like many plugins have.

Is it possible to have preview in script-fus?

If not, I can port to python, is possible to have preview in python
plugins?

And if not, I can try to do a wrapper from C via gimp_run_procedure2.
This will take much more time as C is far away from my knoledge.

Can someone point me on the right direction? and to some example?

Thanks
Pere

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


[Gimp-user] Scaling down.

2007-10-09 Thread Pere Pujal i Carabantes
Hi all!

I usually have to scale down some images, so I ask about the best
practice to do so.

The images (RGB photografies) are in the range of 1000x1000 -
3000x3000px and have to be scaled to a range about 200x200 - 400x400px.

I've read something about go scaling 50% in steps approaching the
desired final size and after that scale to the final size. Is this
needed in gimp 2.4rc* or the internals of scale does yet this?

I've read too about oversharp the image before scaling down:
http://www.robertmekis.com/articles/sharpening/mekis0ta001a1a.html
There is a script that claims to do this, 
http://registry.gimp.org/plugin?id=6929
but I guess that the calls it does to  (gimp-selection-sharpen img) does
not meet the SHARPEN or SHARPEN MORE from photoshop, so what are the
gimp equivalents for SHARPEN or SHARPEN MORE?

I've had problems in the past (gimp 2.3.13) with lanczos alghorithm,
after that I've changed the default interpolation to cubic.  It is time
to give another chance to lanczos?


Any other hints for scaling down are apreciated.
Thanks
Pere 

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


Re: [Gimp-user] remember last location for "save as", "save a copy", "save", "open"

2007-10-04 Thread Pere Pujal i Carabantes
El dt 02 de 10 del 2007 a les 18:20 +0200, en/na Sven Neumann va
escriure:
> Hi,
> 
> On Mon, 2007-10-01 at 23:31 +0200, Pere Pujal i Carabantes wrote:
> 
> > I see the "Recently Used" (files) entry in file-chooser. Can it hold
> > "Recently Used Dirs" ?
> 
> For the Save dialog, this would probably make more sense than presenting
> recently used files. Would probably make sense to bring this up for
> discussion on the gtk-developer list or at least file a bug report for
> it against the GTK+ file-chooser.

Done, see:
http://mail.gnome.org/archives/gtk-devel-list/2007-October/msg00010.html




> 
> If an image already has a filename associated to it, then open the Save
> file-chooser in that folder. Otherwise use the folder of the most recent
> save operation. Would that make sense?

I have to disagree, that can be very confusing. (and very powerfull BTW,
you can change the default saving directory on  the fly):

open a/b/c.xcf (named file)
new unnamed.xcf
new unnamed1.xcf
save unnamed.xcf to d/e/f.xcf (file-chooser comes up)
default saving directory comes d/e
save a/b/c.xcf ( CTRL+S  file-chooser doe not appear as the file has yet
a name)
default saving directory comes a/b nearly without notice
save unnamed1.xcf

What happens? a/b is presented when I just manualy selected d/e in the
previous opened file-chooser.  

What about this?:
If an image already has a filename associated to it, then open the Save
file-chooser in that folder. Otherwise use the folder of the most recent
save operation that implies the use of file-chooser.


Yours
Pere


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


Re: [Gimp-user] remember last location for "save as", "save a copy", "save", "open"

2007-10-02 Thread Pere Pujal i Carabantes
Hi!

El dg 30 de 09 del 2007 a les 12:10 +0200, en/na Sven Neumann va
escriure:

> The application can already add bookmarks and GIMP 2.4 already makes use
> of this feature in some places.

I see the "Recently Used" (files) entry in file-chooser. Can it hold
"Recently Used Dirs" ?


>  I am not convinced though that this
> would be a good way to solve the problems brought up the user who
> started the thread.

No, dir bookmarks not solve any problem, but can come in help when the
gimp assumption about the directory where to save a file and the user
wanted directory differs.

There are two issues here: 
 Find good default saving assumptions for most users.
 What to do when a user has different needs.

Bookmarking recent saving dirs deals with the second case.


> Perhaps we need to collect the typical usage scenarios that involve use
> of the file-chooser and evaluate how the current solution deals with
> them and if there are ways to improve it. 

I just have a suggestion for "paste as new" and is that the default
saving directory for the new image can inherit the default saving
directory from the image where the action is called, or if it is called
from the toolbox, inherite from the active image.

As this, the users can have some control over the default saving
directory.



Yours
Pere


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


Re: [Gimp-user] remember last location for "save as", "save a copy", "save", "open"

2007-09-28 Thread Pere Pujal i Carabantes
El dv 28 de 09 del 2007 a les 19:34 +0200, en/na Sven Neumann va
escriure:

> It's not easy to find a good solution that fits for all cases. For GIMP
> 2.4 we have changed the behavior of the Open and Save dialogs so that
> they open in the last used directory if you are using them from the same
> image. For all other needs, I suggest that you use the Bookmarks feature
> of the file-chooser dialog to avoid having to renavigate the filesystem.

Just a couple of ideas.

May be Gimp can auto add/remove Bookmarks? I guess this can give more
problems than adressed.

Or  may be after modifying file-chooser, there will be a place for
app-bookmarks in plus of user-bookmarks?


Yours
Pere

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


Re: [Gimp-user] New view and layer masks

2007-09-25 Thread Pere Pujal i Carabantes
El dt 25 de 09 del 2007 a les 11:56 +0500, en/na Asif Lodhi va escriure:

> 
> I suggested Quick Mask to Victor because he mentioned he wanted to
> "see" the layer mask and image at the same time because, 

Another way to see both is by playing with transparencies:

Put a duplicate layer of the image on top of the one that has the layer
mask and set transparency to about 40%-60% on the duplicate.


> Thanks & best regards,
> 
> Asif

Yours
Pere

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


[Gimp-user] Clicking on certain parts of the image window does not active it.

2007-09-08 Thread Pere Pujal i Carabantes
Hi all!

Start gimp, display the layers dialog and open two diferent files or
create and draw something on one of them.
In the toolbox go to file -> preferences -->Window management and
uncheck "Activate the focused image"  click on OK

Now click on a window image in the middle, layers dialog thumbnails
updates to that image.

Now click on the scrollbar or quick mask or the zoom botton or the units
botton of the other image, layers dialog does not update.

If instead you click on menubar, main image, helper rules, state... the
image is activated.

Is this the expected behaviour?
If yes, can someone explain what are the advantages?

I understand that when you have a window manager configured to "focus
follow mouse", maybe you don't want an image get activated by accident
just by passing the mouse over, but why the need to click on specific
parts of the window to activate the image?


Yours
Pere

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


Re: [Gimp-user] Script-fu errors after upgrade 2.2.15 => 2.4.0-rc2

2007-09-07 Thread Pere Pujal i Carabantes
El dv 07 de 09 del 2007 a les 15:19 +0200, en/na Jan Tomasek va
escriure:

> I seek help with migrating script-fu script from Gimp 2.2 to 2.4.

> 
> After upgrade to 2.4.0-rc2 script stoped working, first I found problem 
> with (set! variable ...) syntax, I replaced that by (define variable 
> ...) and now I'm getting "Procedural database execution of 
> gimp-floating-sel-anchor failed:" error without any further explanation 
> of problem. I've no idea what get wrong there.
> 
>  (define rtText
> (car
>  (gimp-text-fontname
>   img -1
Why you put img -1 ?? you don't have this in the version for gimp 2.2

And BTW, putting here the old value your script will work.

> 
> Is there some "script-fu migration howto"? Or maybe on this list is 
> someone so kind to check my script... it is attached to this email.
> 

There are nice pages to read:
http://www.ve3syb.ca/software/gimp/tiny-fu.html
http://www.ve3syb.ca/software/gimp/extras.html


> Best regards

Yours
Pere

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


Re: [Gimp-user] Script-fu SF-FILENAME don't show the default setting

2007-09-03 Thread Pere Pujal i Carabantes
On Wed, 2007-08-29 at 01:17 +0200, Pere Pujal i Carabantes wrote:

> When using SF-FILENAME, if the file exist, the name of the file is
> shown
> in the button, but if the file does not exist, ie. has to be created,
> there is "(none)" in the button.
> 
> Is there a way to show the name on the button even if the file does
> not
> exist? 

After some try/error and a look at the code, it seems not. 

SF-Filename uses gtk_file_chooser_button, and acording to
http://library.gnome.org/devel/gtk/2.10/GtkFileChooserButton.html#id3631060
gtk_file_chooser_button only supports the GtkFileChooserActions
GTK_FILE_CHOOSER_ACTION_OPEN and GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
not the GTK_FILE_CHOOSER_ACTION_SAVE

GTK_FILE_CHOOSER_ACTION_OPEN Indicates open mode. The file chooser will
only let the user pick an existing file. 
GTK_FILE_CHOOSER_ACTION_SAVE Indicates save mode. The file chooser will
let the user pick an existing file, or type in a new filename.


So, if someone like I wants to write a nonexistent file, and this file
has to be selected by the user, the obvious solution is to use
SF-DIRNAME to get the directory and follow a SF-STRING to get the
filename.
After that, a (string-append dirname "/" filename) in the code gives the
full path.

Yours
Pere

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


[Gimp-user] Script-fu SF-FILENAME don't show the default setting

2007-08-28 Thread Pere Pujal i Carabantes
Hi all!



When using SF-FILENAME, if the file exist, the name of the file is shown
in the button, but if the file does not exist, ie. has to be created,
there is "(none)" in the button.

Can someone else reproduce?
Is there a way to show the name on the button even if the file does not
exist? 




To test install and run the script below, if you click on "OK" without
selecting a file, the string "nonexistentfile" is shown as a message.

If you select a existent file via the file selector, the name of the
file is show on the button and when click on "OK" the full path is
shown. (the desired behaviour)

If you select a non existent file via file selector (say type the
desired name on "Location:" and press "Open"),  "(none)" is shown on the
button, confusing as one can imagine that the selection has failed, but
when click on "OK" the full path is shown as desired.



The test script:

(define ( script-fu-test-filename
  filename)
  (gimp-message (string-append "Filename: " filename)))
( script-fu-register 
  "script-fu-test-filename"
  "/Script-Fu/Test/testfilename" 
  "Test for SF-FILENAME" 
  ""
  ""
  ""
  ""
  SF-FILENAME "Filename" "nonexistentfile"
  )



Gimp 2.4 RC1 linux Debian unstable


Thanks
Pere

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


Re: [Gimp-user] Some questions about script-fu and tinyscheme.

2007-08-23 Thread Pere Pujal i Carabantes

> For now, I've worked around as this, but looks ugly:
> 

> (for-each (lambda (z)(write-char z txt-output-file ))(string->list
> text-string)) 

better as this:

(display text-string txt-output-file)




BTW The gimp script-fu console segfaults typing something like
(let* (a 1))
Should I post a bug report?

gimp 2.4.0-rc1

Yours
Pere

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


Re: [Gimp-user] Gimp 2.3.18 and script-fu errors

2007-08-23 Thread Pere Pujal i Carabantes
El dj 23 de 08 del 2007 a les 09:49 +0100, en/na David Woodfall va
escriure:
> On (22:49 22/08/07), Pere Pujal i Carabantes <[EMAIL PROTECTED]> put forth 
> the proposition:
> > El dc 22 de 08 del 2007 a les 12:43 +0100, en/na David Woodfall va
> > escriure:

> > > Error: Set!: Unbound variable: new
> > > 

> >   (set! new (car(gimp-layer-copy layer 1))) ; Add an alpha channel
> > by
> >   (define new (car(gimp-layer-copy layer 1))) ; Add an alpha channel
> > 
> > 
> 
> Works thanks. Is set!/define the only difference with the new script
> engine? I edited a few more and all seems well.
> 

I am not sure, I am just learning.
The main difference is the interpreter Tinyscheme vs SIOD, each one has
its own interpretation of the standard.

About set!, it serves to put a value to a variable, not to declare it.
Say open a gimp script-fu console and type the following:

(set! x 1) ---> Error: set!: unbound variable: x 

(define x) ---> x
(set! x 1) ---> 1

As you see, set! works once the variable is declared.


Yours
Pere

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


Re: [Gimp-user] Gimp 2.3.18 and script-fu errors

2007-08-22 Thread Pere Pujal i Carabantes
El dc 22 de 08 del 2007 a les 12:43 +0100, en/na David Woodfall va
escriure:
> I have just downloaded and tested two scripts and get the same error with
> each:
> 
> Error: Set!: Unbound variable: new
> 
> The scripts are gm-invert and gm-solarize. Is there some incompatability
> with newer versions of Gimp and these scripts? Is there an easy way to
> perhaps edit the scripts to get them working?

If you can not wait for them to be fixed,
the lamer way: just have to change on both files

  (set! new (car(gimp-layer-copy layer 1))) ; Add an alpha channel
by
  (define new (car(gimp-layer-copy layer 1))) ; Add an alpha channel



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


Re: [Gimp-user] Some questions about script-fu and tinyscheme.

2007-08-22 Thread Pere Pujal i Carabantes

> Well, I have setted 64MB as max undo memory, but why this set is not
> used when grouping undo?

Solved this, that was a misconfiguration on my hand.
I had setted a minumun undo levels of 5 an this take precedence over the
max memory for undo.


Pere



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


[Gimp-user] Some questions about script-fu and tinyscheme.

2007-08-21 Thread Pere Pujal i Carabantes
Hi!


The first is about writing text to a file.
In SIOD doing something like this I can write text to a file: 

(let* (
(txt-output-file-name (string-append base-filename ".txt"))
(txt-output-file (fopen txt-output-file-name "w")))
(fwrite (string-append text-string "\n")txt-output-file)
(fclose txt-output-file))



If I try the same in tinyscheme it raises an error.
How can I do the same in tinyscheme?


For now, I've worked around as this, but looks ugly:

(begin 
(define text-filename (string-append base-filename ".txt"))
(define txt-output-file (open-output-file text-filename))
(for-each (lambda (z)(write-char z txt-output-file ))(string->list
text-string)) 
(newline txt-output-file))



The second question is about the memory used by gimp-image-undo-group
start->end.
If I use this, my script easy eats all the memory. (It creates, moves
and destroys 49 layers per an undetermined number of runs)


I've created a simple script to test and show:
http://fornol.no-ip.org/linux/gimp/group-undo-test.scm
Defaults to create and destroy 20 layers x 5 runs = 100 layers and
group-undo each run.


Create a new blank image (420x300 pixels)
run the script on it script-fu-->test-->group-undo
If you check group-undo you will get an image about 193MB
If you don't check, the image will use 64.2MB 

Well, I have setted 64MB as max undo memory, but why this set is not
used when grouping undo?


Thanks
Pere

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