Solved

create an image who rotates on itself


Badge +2

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.

icon

Best answer by jdh 17 August 2018, 19:40

View original

20 replies

Userlevel 4
Badge +30

Hi @philippeb

Did you try to use the custom transformer

AnimatedGIFWriter ?

Download

 

Thanks,

Danilo

 

Badge +2

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.

 

 

Badge +3

@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.

Badge +22

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

 

Badge +22

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

 

rotaterasteryaxis.fmw

Badge +2

@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.

 

 

Badge +2

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

 

 

Badge +22
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.
Badge +22
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

 

 

 

 

 

Badge +2
rotateyaxis.fmw

 

 

 

 

 

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

 

Something like this.

 

 

 

Badge +22
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.

 

 

Badge +2
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!!

 

 

Badge +2

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?

Badge +22

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

 

 

Badge +2
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.

 

Badge +22
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/

 

Badge +2
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?

 

 

Badge +22
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).

 

Badge +2
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

 

 

Badge +22
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. :)

 

 

Reply