Skip to main content
Solved

create an image who rotates on itself

  • August 15, 2018
  • 20 replies
  • 79 views

philippeb
Enthusiast
Forum|alt.badge.img+22

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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

20 replies

danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • August 15, 2018

Hi @philippeb

Did you try to use the custom transformer

AnimatedGIFWriter ?

Download

 

Thanks,

Danilo

 


philippeb
Enthusiast
Forum|alt.badge.img+22
  • Author
  • Enthusiast
  • 329 replies
  • August 16, 2018

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
  • 2252 replies
  • 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+37
  • Contributor
  • 2002 replies
  • 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+37
  • Contributor
  • 2002 replies
  • 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+22
  • Author
  • Enthusiast
  • 329 replies
  • August 20, 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.

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

 

 


philippeb
Enthusiast
Forum|alt.badge.img+22
  • Author
  • Enthusiast
  • 329 replies
  • August 20, 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

This is awesome! thanks a lot

 

 


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • August 20, 2018
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+37
  • Contributor
  • 2002 replies
  • August 20, 2018
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+22
  • Author
  • Enthusiast
  • 329 replies
  • August 20, 2018
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+37
  • Contributor
  • 2002 replies
  • August 20, 2018
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+22
  • Author
  • Enthusiast
  • 329 replies
  • August 20, 2018
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+22
  • Author
  • Enthusiast
  • 329 replies
  • 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+37
  • Contributor
  • 2002 replies
  • 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?

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+22
  • Author
  • Enthusiast
  • 329 replies
  • August 20, 2018
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+37
  • Contributor
  • 2002 replies
  • August 20, 2018
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+22
  • Author
  • Enthusiast
  • 329 replies
  • August 20, 2018
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+37
  • Contributor
  • 2002 replies
  • August 20, 2018
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+22
  • Author
  • Enthusiast
  • 329 replies
  • August 21, 2018
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+37
  • Contributor
  • 2002 replies
  • August 21, 2018
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. :)