Sharandra
![]() |
This is my first attempt at scripting in FF.
I am trying to create a script that takes a source and resizes, duplicates and stacks it. I have figured out the resizing and duplicating part, but I can only get it to stack the shapes from the center towards a corner instead of on top of each other. And yes, I fail at math ![]() If anyone has any idea what I´m doing wrong and how to make it work, I´d much appreciate your help ![]() Thx, Shar stacking mapscript.ffxml |
|||||
Posted: June 26, 2012 9:53 am | ||||||
Sharandra
![]() |
![]() |
|||||
Posted: June 26, 2012 10:00 am | ||||||
Morgantao
![]() |
Is there a way for a script to know the image dimentions?
|
|||||
Posted: June 26, 2012 10:50 am | ||||||
Sphinx.
![]() |
try
|
|||||
Posted: June 27, 2012 12:58 am | ||||||
Sharandra
![]() |
||||||
Posted: June 27, 2012 9:56 am | ||||||
Sharandra
![]() |
||||||
Posted: June 27, 2012 10:46 am | ||||||
Morgantao
![]() |
I'm sorry, but I can't reproduce that image you posted... What's your secret?
Also, I can't seem to get the direction slider do anything... What am I missing? Thanks! |
|||||
Posted: June 28, 2012 1:20 am | ||||||
Sharandra
![]() |
The image was done with my new filter Bubble fun, thats why you can´t reproduce it with the script
![]() And the direction slider currently does nothing, it was left over from trying to figure out how to change the stacking direction ![]() I want to make some more changes to the script, will post an update then. |
|||||
Posted: June 28, 2012 7:06 am | ||||||
Morgantao
![]() |
Ah, OK.
|
|||||
Posted: June 28, 2012 7:09 am | ||||||
Sharandra
![]() |
while the stacking part works now, and I can offset it, or have it centered now, I´m still having issues with the script.
Above certain values for repeating and spacing it starts multiplying the whole stack instead the image, which leads to a kaleidoscope like effect. While that is interesting and fun, it´s not what I really wanted. And I have no clue why ![]() Sphinx, or anyone else, do you have any idea why that happens and could you try to explain it to me? |
|||||
Posted: June 28, 2012 2:12 pm | ||||||
Morgantao
![]() |
I think I know WHY this happens, I just don't know how to avoid it.
The reason is that whenever FF goes out of the bounds of the image, it mirrors the image as a filler. You can see the same thing happen when you use the scale or rotate components. I suppose in your script, when the offset is too great, FF mirrors what it already has inside the image bounds, and duplicates it on top of what you have, as if this is an actual part of the image. |
|||||
Posted: June 28, 2012 4:03 pm | ||||||
Sharandra
![]() |
Yeah, I think that´s exactly the problem. I had a play with the scale component and it does the same thing. I tricked it by putting a frame around the scaled imaged, but that has it´s limits too.
I hope they add some components for effects like this in the future. Juggling 50 components just for one simple effect is annoying. I can do this in Photoshop in like 30 seconds by just duplicating and scaling the layers, and record an action for future use. It´s even faster than waiting for FF to render it ![]() No need to create a filter for it I guess. Apart from the pleasure to create something for other people to have fun with ![]() |
|||||
Posted: June 28, 2012 8:54 pm | ||||||
Sharandra
![]() |
Multiplying scales, adding and substracting offsets the image, what makes it rotate?
|
|||||
Posted: June 29, 2012 9:08 am | ||||||
Morgantao
![]() |
Sorry, didn't understand the question...
|
|||||
Posted: June 29, 2012 2:31 pm | ||||||
SpaceRay
![]() |
Well, yes, is true that you can do it and make it much better in Photoshop and much faster than in FF, and get the effect as you want, and do not need a FF filter for this and I agree... ...BUT what I think would be interesting is to be able to customize and define the effect in many different ways and to be able to multiply the image as required and as many or few as you want, and change the orientation and offset and some other settings that would not be possible to make in a Photoshop Action. |
|||||
Posted: June 29, 2012 2:48 pm | ||||||
Sharandra
![]() |
ri,gi,bi,ai = get_sample_map(x,y IMAGE) Adding or subtracting from x and y offsets the image, multiplying scales it. As far as I could figure it out. How can you add a rotation? For example the image around its center, or the duplicates in my script around the center. Dunno if that makes it any clearer.
I agree. That was the reason I started creating this script anyway, to have a customizable component that does this which we can use in our filters. |
|||||
Posted: June 29, 2012 5:41 pm | ||||||
Morgantao
![]() |
Yep that makes your question much clearer. now we need Sphinx to answer it
![]() |
|||||
Posted: June 29, 2012 5:54 pm | ||||||
Sharandra
![]() |
I managed to get rid of the unwanted repetitions. It was the spacing settings that caused it. It can only be between 0.01 and 0.04 to work, so I just set it to 0.04 and got rid of the input. Also apparently 30 is the maximum for repetitions for some reason.
Still got some things to fix, but here is an updated version for now. I added in some example shapes, play around with it and try out adding your own ![]() stacking mapscript 2.ffxml |
|||||
Posted: June 30, 2012 8:58 pm | ||||||
Sharandra
![]() |
||||||
Posted: June 30, 2012 9:00 pm | ||||||
Sharandra
![]() |
||||||
Posted: June 30, 2012 9:01 pm | ||||||
Sharandra
![]() |
||||||
Posted: June 30, 2012 9:11 pm | ||||||
Morgantao
![]() |
Looking good!
|
|||||
Posted: July 1, 2012 2:21 am | ||||||
SpaceRay
![]() |
very good that you found the reason of the unwanted repetitions and have been able to fix it. I like the results and looks good.
Good idea to add this added shapes and is better for looking at the results and get this nice ball and rings designs. Like how you have done it. The one I like more is the example shown below, if it would be possible to replace a image with transparency in the place of the balls shown and with the same spacing, it would be really great!! Thanks very much for working on this and you are doing it very well. ![]() |
|||||
Posted: July 1, 2012 2:41 am | ||||||
Sharandra
![]() |
||||||
Posted: July 1, 2012 7:10 am | ||||||
Sharandra
![]() |
||||||
Posted: July 1, 2012 7:13 am | ||||||
Sharandra
![]() |
Ok, need help again:
Lets say I have a free ellipse. Now I want that to always be for example in the center of the image, no matter what size it is. How can I convert the OUTPUT_HEIGHT, OUTPUT_WIDTH values to values the offset wants? Edit: this is what I got so far
My problem is that I can get it to work either if the image is higher than wide, or wider than high, but not at the same time. |
|||||
Posted: January 28, 2013 4:11 pm | ||||||
Sharandra
![]() |
||||||
Posted: January 28, 2013 5:46 pm | ||||||
ThreeDee
![]() |
You probably need an IF statement that does a different calculation depending on whether OUTPUT_HEIGHT is bigger or smaller than OUTPUT_WIDTH.
|
|||||
Posted: February 7, 2013 11:12 am | ||||||
ThreeDee
![]() |
Sine, Cosine, ArcSine and ArcCosine can be used to get linear coordinates converted to rotation angles and vice versa. You have to calculate them from the center point (.5,.5) to get the rotation around center. |
|||||
Posted: February 7, 2013 11:17 am | ||||||
Sharandra
![]() |
Doh! Simple! Why didn´t I think of that?! >.< Thanks Threedee, you´re a star! ![]()
Too much Math in one sentence (no offence ment). ![]() ![]() |
|||||
Posted: February 8, 2013 3:10 am | ||||||
Indigo Ray
![]() |
You have to use polar coordinates, Shar.
You already know X (horizontal position) and Y (vertical position). To convert to polar coordinates: ![]() X = r*cos(theta) Y = r*sin(theta) where r = radial distance from the center and theta = angle around the center If you want to rotate around the center, you keep r the same but you shift theta. Hmmm... I should assign you some homework...by next Friday, replicate all of these graphs: ![]() ![]() |
|||||
Posted: February 8, 2013 11:25 am | ||||||
Sharandra
![]() |
Oh wow, thx Indigo! You´re a star aswell!
![]() I´ll give it a try when I´m finished with my other stuff!! Not sure about the homework, but I think I can do a simple rotation based on your explanation. ![]() |
|||||
Posted: February 8, 2013 2:47 pm |
Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!
33,712 Registered Users
+19 new in 30 days!
153,534 Posts
+31 new in 30 days!
15,348 Topics
+72 new in year!
34 unregistered users.