GT Portal . Forums . Official Tutorials . Art Galleries . FAQs . Search . New Posts . Contact Us Login  .  Register


GimpTalk Announcement :
Try your digital-art skills against your fellow gimpers in GIMPtalk's Biweekly Art competition !


Board index » GIMP Art Galleries and Resources » GIMP Plugins, Filters, and Scripts Make Money Online . Free Image Hosting Script . Convert FLV to Cell Phone Format
Featured Tutorial : Learn how to create characters by Griatch
Search for :  


Post new topic Reply to topic   [ 15 posts ]  


Author Message
 Post subject:
PostPosted: Sun Apr 16, 2006 2:42 am 
Offline
User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics: 598
Posts: 7370

Find User's Topics

i use often this effect (original image+mirrored)
Image
(image:my manipolation of a photo of http://regenstock.deviantart.com)

i'm looking for a plugin or a script to do similar effect with gimp,please note that
1)final image size has to be doubled
2)proportion ratio has to change (if the original is 1x1 the result will be 1x2 if mirrored down or up, or 2x1 if mirrored right or left
I didn't find anything doing such simple thing for gimp have you some tips?


_________________
Image

http://www.flickr.com/photos/97844002@N00/


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 16, 2006 3:33 pm 
Offline
User avatar

Joined:
Fri Feb 10, 2006 12:54 am

Topics: 20
Posts: 333

Find User's Topics
You want to mirror an image? Hm...

Okay, let's assume horizontal flip is what you want. Double the canvas size horizontally, copy the layer, and use layer -> transform -> flip horizontally. You may have to change the layer orientation a bit, but it'll work.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 17, 2006 6:19 pm 
Offline
User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics: 598
Posts: 7370

Find User's Topics
That is correct ...but ....i use very often this effect so i would like do in only one step with a script or a plugin,...like i did in the sample image with a very simple freeware (photofiltre) with just 1 click

_________________
Image

http://www.flickr.com/photos/97844002@N00/


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 17, 2006 6:43 pm 
Offline

Joined:
Mon Jan 30, 2006 3:11 pm

Topics: 22
Posts: 273

Find User's Topics
http://manual.gimp.org/en/gimp-using-sc ... orial.html

Might not be the answer you are looking for, but mastering one of GIMP's script languages might help you a lot in general. Besides, script-fu isn't that hard to learn. Hopefully in the future GIMP will have a macro recorder that will generate your script from a few key/mouse clicks.

_________________
Website: http://sourceforge.net/projects/gimp-sharp/
Blog: http://maurits.wordpress.com/


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Mon Apr 17, 2006 11:37 pm 
Offline
User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics: 598
Posts: 7370

Find User's Topics
:h: I'm reading it ...but before put my mind in it i would like like to know if is possible to use it for what i need :
for exemple with script fu is possible give command to change imagine size and ratio? starting for a square with base 1 the output must be a rectangle with base(or height) 2 ...i ask because first i try with LUA but soon i discover that this was not possible (at least this was the opinion of LUA developer)

_________________
Image

http://www.flickr.com/photos/97844002@N00/


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 1:34 am 
Online
User avatar

Joined:
Mon Aug 22, 2005 8:35 pm

Topics: 80
Posts: 3943

Find User's Topics
Perhaps this script will satisfy your needs.

Code:
(define (script-fu-mirror-dup image layer iterations horizontal vertical workcopy)
  (let* (
    (work-image)
    (new-layer)
    (orig-width)
    (orig-height)
    )
   
    (if (= workcopy TRUE)
      (begin
        (set! work-image (car (gimp-image-duplicate image)))
        (gimp-display-new work-image)
        )
      (begin
        (set! work-image image)
        (gimp-image-undo-group-start image)
        )
      )
    (while (> iterations 0)   
      (set! layer (car (gimp-image-get-active-layer work-image)))
      (if (> (car (gimp-image-get-layers work-image)) 1)
        (set! layer (car (gimp-image-merge-visible-layers work-image EXPAND-AS-NECESSARY)))
        )
      (if (= horizontal TRUE)
        (begin
          (set! new-layer (car (gimp-layer-copy layer 1)))
          (gimp-image-add-layer work-image new-layer -1)
          (set! orig-width (car (gimp-drawable-width new-layer)))
          (set! orig-height (car (gimp-drawable-height new-layer)))
          (gimp-layer-resize
              new-layer
              (* 2 orig-width)
                orig-height
                0
                0
                )
          (set! new-layer (car (gimp-drawable-transform-flip-simple new-layer
              ORIENTATION-HORIZONTAL
              TRUE
              orig-width
              0))
            )
          (gimp-image-resize-to-layers work-image)
          (if (> (car (gimp-image-get-layers work-image)) 1)
            (set! layer (car (gimp-image-merge-visible-layers work-image EXPAND-AS-NECESSARY)))
            )
          )
        )
      (if (= vertical TRUE)
        (begin
          (set! new-layer (car (gimp-layer-copy layer 1)))
          (gimp-image-add-layer work-image new-layer -1)
          (set! orig-width (car (gimp-drawable-width new-layer)))
          (set! orig-height (car (gimp-drawable-height new-layer)))
          (gimp-layer-resize
              new-layer
              orig-width
              (* 2 orig-height)
              0
              0
              )
          (set! new-layer (car (gimp-drawable-transform-flip-simple new-layer
              ORIENTATION-VERTICAL
              TRUE
              orig-height
              0))
            )
          (gimp-image-resize-to-layers work-image)
          )
        )
      (set! iterations (- iterations 1))
      )
    (gimp-selection-none work-image)
    (if (> (car (gimp-image-get-layers work-image)) 1)
      (set! layer (car (gimp-image-merge-visible-layers work-image EXPAND-AS-NECESSARY)))
      )
    (gimp-displays-flush)
    )
  (if (= workcopy FALSE)
    (gimp-image-undo-group-end image)
    )
  )

(script-fu-register "script-fu-mirror-dup"
"<Image>/Script-Fu/Transform/Mirror"
"Duplicates the image with mirror images"
"Saul Goode"
"Saul Goode"
"4/17/2006"
""
SF-IMAGE    "Image"    0
SF-DRAWABLE "Drawable" 0
SF-ADJUSTMENT "Iterations (Image doubles each time)" '( 1 0 5 1 1 0 1 )
SF-TOGGLE "Horizontal direction" TRUE
SF-TOGGLE "Vertical direction" FALSE
SF-TOGGLE "Work on copy" TRUE
)


_________________
this is bizarre ... it's crazy ... it's stupid ... how can this ... oh my God! It's brilliant!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 7:07 am 
Offline
User avatar

Joined:
Wed Jul 13, 2005 11:31 am

Topics: 121
Posts: 474

Find User's Topics
You could try this out Quick Mirror

_________________
I know I'm in my own little world. But its ok. They know me HERE


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 7:29 am 
Online
User avatar

Joined:
Mon Aug 22, 2005 8:35 pm

Topics: 80
Posts: 3943

Find User's Topics
Meh. Mine's better. :l:

_________________
this is bizarre ... it's crazy ... it's stupid ... how can this ... oh my God! It's brilliant!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 1:10 pm 
Offline
User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics: 598
Posts: 7370

Find User's Topics
:h:
Quote:
Meh. Mine's better.

thank you a lot Saulgood it look like exactly what i was looking for ,i'm going to try it soon... :h:


Capnhud ,thank for the link, i forget about that plugin because is quite boring to use (for example the convas size has to be manually resized before starting it,if you forgot nothing happen)... now i remember also about 2 very old PS plugin (called something alike x-mirror and y-mirror) that have not that drawback(but were 2 for the work that could be done from a single 1,more was something unconfortable in using them that now i could not remind)...

till i can choose i found more educative try a script -fu ( i even dream about customize it,will be nice adding a chance for horizontal or vertical cropping before mirroring,....but it's not so important and it's just a fantasy ,a accurate crop will require a good preview ...more till now learn to use script fu language seems not so simple all reference text are not in my native langauge and i have no any experience in programming....)

_________________
Image

http://www.flickr.com/photos/97844002@N00/


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 6:15 pm 
Offline
User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics: 598
Posts: 7370

Find User's Topics
:h:Yes Saulgoode itis exactly was i was looking for and it work fine...thank you a lot , you make me happy:w:

BTW the voice "iteration" it's a little tricky...since size grow up in a logaritmic way, a little mistake could means ask to gimp to handle something alike a 2400MB image ...maybe a checkbox as ask confirm if final size is more then (e.g.)100MB could be useful for not experienced users? but i don't care for me is a beatiful tool! thank again!

_________________
Image

http://www.flickr.com/photos/97844002@N00/


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 22, 2006 12:04 pm 
Offline
User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics: 598
Posts: 7370

Find User's Topics
:h: :l: :w:

_________________
Image

http://www.flickr.com/photos/97844002@N00/


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 15, 2006 11:35 pm 
Offline
User avatar

Joined:
Mon May 15, 2006 5:31 am

Topics: 27
Posts: 618

Find User's Topics
A truly incredible script! It does a beautiful job!

Thanks!

Greg

_________________
Image

My Sigs = My Photos
Check out my work at http://www.flickr.com/photos/photomastergreg.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 18, 2006 1:27 am 
Offline

Joined:
Sun Apr 16, 2006 12:41 am

Topics: 10
Posts: 44

Find User's Topics
umm what do you do with that bunch of wwords? lol I need this, but Im don't have thge slightest idea how adding something like that works.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 18, 2006 4:26 am 
Online
User avatar

Joined:
Mon Aug 22, 2005 8:35 pm

Topics: 80
Posts: 3943

Find User's Topics
That "bunch of words" is Script-fu code and needs to be saved as a file in your GIMP's "scripts" directory. The filename does not matter other than it must have the ".scm" extension for the GIMP to recognize it.

There is a nice tutorial in the FAQ which goes into detail about adding scripts to the GIMP (a VERY NICE tutorial).

The "bunch of words" is available as a downloadable file ("mirror-dup.scm") from HERE.

WARNING!!! As Fotocomics pointed out, large values of "Iterations" might result in VERY large files (up to a million times the original size). Personally, I do not like for software to try to outsmart the user, so the script does not check for this (there are times when it is useful to "tile" a small image a thousand times). You are free to modify the script to provide such protection if you wish.

_________________
this is bizarre ... it's crazy ... it's stupid ... how can this ... oh my God! It's brilliant!


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 23, 2006 7:37 pm 
Offline
User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics: 598
Posts: 7370

Find User's Topics
i will like to know how to add a conditional warning,i mean something like "do you really want create a image of more than XXXMB?... with just yes or not as answers...
It's not something i really need .. but i will like to know how to do it and i will appreciate a link about "how to create conditional warning or conditional lock in script fu" or even a sample of it

_________________
Image

http://www.flickr.com/photos/97844002@N00/


Top
 Profile  
 
Display posts from previous:  Sort by  

Post new topic Reply to topic
 [ 15 posts ] 



Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Related Website
Gimp tutorials database
All rights reserved © GimpTalk 2008
forum software by
phpBB