Skip to main content
Solved

create an image who rotates on itself


philippeb
Enthusiast
Forum|alt.badge.img+20

I have a bunch of images that I want to rotate on their self. Like this example.

Do you know an API that I could use in FME or a transformer that could do the job?

Thanks.

Best answer by jdh

While a true perspective rotation would give superior results, if the image is simple enough it can be approximated by X-compression.

 

rotaterasteryaxis.fmw

View original
Did this help you find an answer to your question?

20 replies

danilo_fme
Evangelist
Forum|alt.badge.img+45
  • Evangelist
  • August 15, 2018

Hi @philippeb

Did you try to use the custom transformer

AnimatedGIFWriter ?

Download

 

Thanks,

Danilo

 


philippeb
Enthusiast
Forum|alt.badge.img+20
  • Author
  • Enthusiast
  • August 16, 2018
danilo_fme wrote:

Hi @philippeb

Did you try to use the custom transformer

AnimatedGIFWriter ?

Download

 

Thanks,

Danilo

 

It looks like the transformer that I need. I've installed the software on my machine and I'm able to run the transformer.

 

 

Now I have to make my rotation directly from the workbench (at first I though I had to use some functions from ImageMagik and write the code doing the job, but the transformer doesn't support that).

 

So how can I give my JPG a 3D rotation with an infinite loop? I tried the 3DForcer before 3DRotater but it doesn't change anything, the raster stays in 2D.

 

 


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • August 17, 2018

@philippeb

You apparently can't rotate rasters in 3D using fme (3Drotator nor 3D affiner).

But you can of course rotate vectors. So, rotate the vector and output for every degree increment, rasterize and send to image magick (with or without the use of a "custom" transformer..)

It'll take a couple of sec to make a bulb like that, I gather.


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • August 17, 2018

Given that FME does not currently support 3D affining for rasters, if you would like FME to control the transformation, I suggest using a SystemCaller to run a set of imageMagick scripts to produce the rotation.

 

 

See the pan portion of http://www.fmwconcepts.com/imagemagick/rotate3D/index.php

 


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • August 17, 2018

While a true perspective rotation would give superior results, if the image is simple enough it can be approximated by X-compression.

 

rotaterasteryaxis.fmw


philippeb
Enthusiast
Forum|alt.badge.img+20
  • Author
  • Enthusiast
  • August 20, 2018
gio wrote:

@philippeb

You apparently can't rotate rasters in 3D using fme (3Drotator nor 3D affiner).

But you can of course rotate vectors. So, rotate the vector and output for every degree increment, rasterize and send to image magick (with or without the use of a "custom" transformer..)

It'll take a couple of sec to make a bulb like that, I gather.

Hum, not sure to understand where is the vector in this situation.

 

 


philippeb
Enthusiast
Forum|alt.badge.img+20
  • Author
  • Enthusiast
  • August 20, 2018
jdh wrote:

While a true perspective rotation would give superior results, if the image is simple enough it can be approximated by X-compression.

 

rotaterasteryaxis.fmw

This is awesome! thanks a lot

 

 


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • August 20, 2018
philippeb wrote:
Hum, not sure to understand where is the vector in this situation.

 

 

gio is suggesting that you take your source image, vectorize it, rotate the vectors in 3D, and then rerasterize the rotated vectors.

 

 

Although that would work, it would probably be more efficient to coerce to pointcloud.

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • August 20, 2018
jdh wrote:
gio is suggesting that you take your source image, vectorize it, rotate the vectors in 3D, and then rerasterize the rotated vectors.

 

 

Although that would work, it would probably be more efficient to coerce to pointcloud.
rotateyaxis.fmw

 

 

 

 

 


philippeb
Enthusiast
Forum|alt.badge.img+20
  • Author
  • Enthusiast
  • August 20, 2018
jdh wrote:
rotateyaxis.fmw

 

 

 

 

 

Do you know how I could get the other side of the circle into a different color?

 

Something like this.

 

 

 


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • August 20, 2018
philippeb wrote:
Do you know how I could get the other side of the circle into a different color?

 

Something like this.

 

 

 

Assuming you have both images to start with and they are the same, as opposed to a mirror image, change the cloner to be 18 as opposed to 36, for the backside image (tester) add 18 to the _copynum, before the 3DRotator.

 

After the image Rasterizer add a sorter, numeric, ascending.

 

 

If the backside image is the mirror image, then add 18 to the copynum after the 3DRotator.

 

 


philippeb
Enthusiast
Forum|alt.badge.img+20
  • Author
  • Enthusiast
  • August 20, 2018
jdh wrote:
gio is suggesting that you take your source image, vectorize it, rotate the vectors in 3D, and then rerasterize the rotated vectors.

 

 

Although that would work, it would probably be more efficient to coerce to pointcloud.
I confirm that it works perfectly! Thanks a lot for all your help!!

 

 


philippeb
Enthusiast
Forum|alt.badge.img+20
  • Author
  • Enthusiast
  • August 20, 2018

I have a problem with the AnimatedGIFWriter.

It looks that I can't write files in batch, using an attribute value for the file name.

It gives me a -0 file without any extension.

Can you replicate the problem?


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • August 20, 2018
philippeb wrote:

I have a problem with the AnimatedGIFWriter.

It looks that I can't write files in batch, using an attribute value for the file name.

It gives me a -0 file without any extension.

Can you replicate the problem?

The animatedGIFWriter is not designed for multiple output files.

 

 

Two things to try.

 

1) Edit the custom transformer to enable Parallel Processing, and set the Parallel Process By to the IMAGEID

 

 

2) Use Batch Deploy to process your files

 

 


philippeb
Enthusiast
Forum|alt.badge.img+20
  • Author
  • Enthusiast
  • August 20, 2018
jdh wrote:
The animatedGIFWriter is not designed for multiple output files.

 

 

Two things to try.

 

1) Edit the custom transformer to enable Parallel Processing, and set the Parallel Process By to the IMAGEID

 

 

2) Use Batch Deploy to process your files

 

 

Unfortunatly :

 

1- Into the custom transformer I don't see any transformer using the Parallel Processing.

 

 

2- I have similar results with the Batch Deploy. It's successful but it writes a -0 file when I put IMAGEID into the output Gif file. It seems that I need a Reader and a Writer (AnimatedGif doesn't count) to make a Batch Deploy. I created a dump Disabled Writer. Not sure how to use the IMAGEID with AnimatedGif in this case.

 

 

I thought about a WorkspaceRunner maybe, but again if the AnimatedGif doesn't support attribute values, I'm stuck...

 

 

Doesn't work this way neither.

 


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • August 20, 2018
philippeb wrote:
Unfortunatly :

 

1- Into the custom transformer I don't see any transformer using the Parallel Processing.

 

 

2- I have similar results with the Batch Deploy. It's successful but it writes a -0 file when I put IMAGEID into the output Gif file. It seems that I need a Reader and a Writer (AnimatedGif doesn't count) to make a Batch Deploy. I created a dump Disabled Writer. Not sure how to use the IMAGEID with AnimatedGif in this case.

 

 

I thought about a WorkspaceRunner maybe, but again if the AnimatedGif doesn't support attribute values, I'm stuck...

 

 

Doesn't work this way neither.

 

The parallel process is in the navigation pane of the custom transformer/

 


philippeb
Enthusiast
Forum|alt.badge.img+20
  • Author
  • Enthusiast
  • August 20, 2018
jdh wrote:
The parallel process is in the navigation pane of the custom transformer/

 

Nice I didn't know this place!

 

I can't find the way to Group By the process though, it's disabled.

 

And I put Incoming Attributes to All.

 

What's missing?

 

 


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • August 20, 2018
jdh wrote:
The parallel process is in the navigation pane of the custom transformer/

 

When you change the parallel processing to anything other than No Parallelism, the Parallel Process By automatically becomes a published parameter. Go back to the main canvas and set it there.

 

 

However, as written the custom transformer does not work with variables as the attribute name.

 

 

The simplest way to fix it is to add a ParameterFetcher before the Aggregator (Parameter Name: GIFOUTPUT), on the Aggregator add the _GIFOUTPUT attribute to the Group By, and on the AttributeCreator replace $(GIFOUTPUT) by @Value(_GIFOUTPUT).

 


philippeb
Enthusiast
Forum|alt.badge.img+20
  • Author
  • Enthusiast
  • August 21, 2018
jdh wrote:
When you change the parallel processing to anything other than No Parallelism, the Parallel Process By automatically becomes a published parameter. Go back to the main canvas and set it there.

 

 

However, as written the custom transformer does not work with variables as the attribute name.

 

 

The simplest way to fix it is to add a ParameterFetcher before the Aggregator (Parameter Name: GIFOUTPUT), on the Aggregator add the _GIFOUTPUT attribute to the Group By, and on the AttributeCreator replace $(GIFOUTPUT) by @Value(_GIFOUTPUT).

 

Amazing, it's working! I must say, you know well your FME! Thanks a lot!

 

My final workbench is sooo cool now!! Users will be amazed :D

 

 


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • August 21, 2018
philippeb wrote:
Amazing, it's working! I must say, you know well your FME! Thanks a lot!

 

My final workbench is sooo cool now!! Users will be amazed :D

 

 

17 years of experience does add up. :)

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings