It is currently Sat Jul 20, 2024 8:25 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: step7 Picture In Picture mod
PostPosted: Tue Jun 26, 2012 4:51 pm  (#1) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
This is a mod of step7 Picture In Picture MathMap expression. I hacked in a rotate option.
#Picture In Picture V0.0a
#Written by step7 (2012)
#Mod by odinbc added Rotate option(2012-06-26)
#Insets a positionable, scalable 2nd image within a main image
#
#Wiring:
#in1 - Primary image
#in2 - Secondary image to be inset into primary image
#
#User Values:
#PiP_x, PiP_y - position inset image
#PiP_scale - Main image is scaled down by this factor
#when producing the inset (have fun with scaling <1)
#PiP_opacity - Sets the inset opacity
#
#
#Contact me about the filter on Gimp Chat Forum or Mathmap Google Group
#
filter geom_rotate (image in, float angle: 0-6.283)
  in(ra + ra:[0, angle])
end
filter PiP(image in1, image in2, float PiP_x:-1-1 (0.6), float PiP_y:-1-1 (-0.6),float PiP_scale:0-16 (3.5),float PiP_opacity:0-1 (1))
qq=in2(xy:[(x-PiP_x)*PiP_scale,(y-PiP_y)*PiP_scale]);alp=alpha(qq)*PiP_opacity;in1(xy)*(1-alp)+qq*alp end

filter PIP_mod(image PiP_in1, float PiP_PiP_x : -1.000000 - 1.000000 (0.600000), float PiP_PiP_y : -1.000000 - 1.000000 (-0.600000), float PiP_PiP_scale : 0.000000 - 16.000000 (3.500000), float PiP_PiP_opacity : 0.000000 - 1.000000 (1.000000), image geom_rotate_in, float geom_rotate_angle : 0.000000 - 6.283000 (0.000000))
    geom_rotate_out = geom_rotate(geom_rotate_in, geom_rotate_angle);
    PiP_out = PiP(PiP_in1, geom_rotate_out, PiP_PiP_x, PiP_PiP_y, PiP_PiP_scale, PiP_PiP_opacity);
    PiP_out(xy)
end


Attachments:
File comment: Rotate option
pip_mod_004_3_0-gc.jpg
pip_mod_004_3_0-gc.jpg [ 97.89 KiB | Viewed 2758 times ]

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Last edited by Odinbc on Sun Jul 01, 2012 2:07 pm, edited 1 time in total.
Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: step7 Picture In Picture mod
PostPosted: Tue Jun 26, 2012 5:03 pm  (#2) 
Offline
GimpChat Member

Joined: Jun 21, 2012
Posts: 106
Nice one dude, this was the sort of thing I intended it for - I will post an updated version when I get time which will have rotation built in, an option to turn transparency honouring on/off (things get weird if your input image has large transparent areas) and maybe even an option to automatically put a photo frame around the inset. I try and keep the user values to a minimum on the filters I'm writing though as my compositions have that many filters the user values window gets longer than that ski run!

I'm sure I recognise that lift, is it in the Banff NP?


Top
 Post subject: Re: step7 Picture In Picture mod
PostPosted: Tue Jun 26, 2012 5:10 pm  (#3) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
It's one of the local Vancouver mountains, either Grouse or Cypress.

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: step7 Picture In Picture mod
PostPosted: Tue Jun 26, 2012 11:55 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Eagerly awaiting for the new version to be posted, maybe rotate X and Y

'mathmap rules'

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Last edited by Graechan on Wed Jun 27, 2012 1:28 am, edited 1 time in total.

Top
 Post subject: Re: step7 Picture In Picture mod
PostPosted: Tue Jun 26, 2012 11:56 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14715
Location: USA
Nicely done Odin. :)
Thanks.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: step7 Picture In Picture mod
PostPosted: Sun Jul 01, 2012 12:28 pm  (#6) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
@Odinbic

that code can't work, the error is the uncommented first line.

here below the corrected code...please could you correct it also in your first message ?

#Picture In Picture V0.0a
#Written by step7 (2012)
#Mod by odinbc added Rotate option(2012-06-26)
#Insets a positionable, scalable 2nd image within a main image
#
#Wiring:
#in1 - Primary image
#in2 - Secondary image to be inset into primary image
#
#User Values:
#PiP_x, PiP_y - position inset image
#PiP_scale - Main image is scaled down by this factor
#when producing the inset (have fun with scaling <1)
#PiP_opacity - Sets the inset opacity
#
#
#Contact me about the filter on Gimp Chat Forum or Mathmap Google Group
#
filter geom_rotate (image in, float angle: 0-6.283)
  in(ra + ra:[0, angle])
end
filter PiP(image in1, image in2, float PiP_x:-1-1 (0.6), float PiP_y:-1-1 (-0.6),float PiP_scale:0-16 (3.5),float PiP_opacity:0-1 (1))
qq=in2(xy:[(x-PiP_x)*PiP_scale,(y-PiP_y)*PiP_scale]);alp=alpha(qq)*PiP_opacity;in1(xy)*(1-alp)+qq*alp end

filter PIP_mod(image PiP_in1, float PiP_PiP_x : -1.000000 - 1.000000 (0.600000), float PiP_PiP_y : -1.000000 - 1.000000 (-0.600000), float PiP_PiP_scale : 0.000000 - 16.000000 (3.500000), float PiP_PiP_opacity : 0.000000 - 1.000000 (1.000000), image geom_rotate_in, float geom_rotate_angle : 0.000000 - 6.283000 (0.000000))
    geom_rotate_out = geom_rotate(geom_rotate_in, geom_rotate_angle);
    PiP_out = PiP(PiP_in1, geom_rotate_out, PiP_PiP_x, PiP_PiP_y, PiP_PiP_scale, PiP_PiP_opacity);
    PiP_out(xy)
end

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: step7 Picture In Picture mod
PostPosted: Sun Jul 01, 2012 1:46 pm  (#7) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
I see no difference or error between my expression example and yours. It's a simple expression experiment; that's what MathMap is for. My example was left, on purpose the way it is, so the difference is easy to see.

I'd love to see any changes, improvements or others expressions your playing with :)

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: step7 Picture In Picture mod
PostPosted: Sun Jul 01, 2012 1:51 pm  (#8) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
"#" !!

the first line of the comment was missing "#" so was read as code giving a parse error.

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: step7 Picture In Picture mod
PostPosted: Sun Jul 01, 2012 2:09 pm  (#9) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
Fixed!

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) A picture says it all.

4

No new posts Attachment(s) how to place text exactly into the picture - is there any help?

8

No new posts WebP picture for the attachment

1

No new posts Attachment(s) Feather in gimp gives unwanted lines in picture - SOLVED

9



* Login  



Powered by phpBB3 © phpBB Group