Skip to main content
Solved

Resize Image without degradation

  • November 5, 2019
  • 6 replies
  • 428 views

philippeb
Enthusiast
Forum|alt.badge.img+18

Hello,

I want to resize an image. Per example 1000*1000 pixels to 200*200 pixels.

I tried RasterResampler, but I only get a degradation of the image, with the same size.

Is there a way to do that?

This is not my family : legacy from Google Images.

 

In M$Paint I would use this.

Best answer by daveatsafe

Hi @philippeb,

Please set the Interpolation Type in the RasterResampler to Bicubic. This setting gives the best results for photos. The default Nearest Neighbor works best on elevation models.

Please note that the extents of the image in Data Inspector will not change, since the georeferencing was created when the image was read, and is not changed by the resampling. The pixel spacing will change to reflect the new pixel size, though. This georeferencing will be discarded if you write out to a non-geographic format, like PNG, JPG or TIFF.

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

6 replies

daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • Best Answer
  • November 5, 2019

Hi @philippeb,

Please set the Interpolation Type in the RasterResampler to Bicubic. This setting gives the best results for photos. The default Nearest Neighbor works best on elevation models.

Please note that the extents of the image in Data Inspector will not change, since the georeferencing was created when the image was read, and is not changed by the resampling. The pixel spacing will change to reflect the new pixel size, though. This georeferencing will be discarded if you write out to a non-geographic format, like PNG, JPG or TIFF.


philippeb
Enthusiast
Forum|alt.badge.img+18
  • Author
  • Enthusiast
  • November 5, 2019
daveatsafe wrote:

Hi @philippeb,

Please set the Interpolation Type in the RasterResampler to Bicubic. This setting gives the best results for photos. The default Nearest Neighbor works best on elevation models.

Please note that the extents of the image in Data Inspector will not change, since the georeferencing was created when the image was read, and is not changed by the resampling. The pixel spacing will change to reflect the new pixel size, though. This georeferencing will be discarded if you write out to a non-geographic format, like PNG, JPG or TIFF.

Good, it works perfectly with JPEG. Do you think it would be possible to write the resized image into a 3D PDF ?


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • November 5, 2019
philippeb wrote:

Good, it works perfectly with JPEG. Do you think it would be possible to write the resized image into a 3D PDF ?

Sure - just use a FaceReplacer transformer to convert the image to a Face textured with that same image, which is suitable for writing to 3D PDF.


philippeb
Enthusiast
Forum|alt.badge.img+18
  • Author
  • Enthusiast
  • November 6, 2019

resizedimageinto3dpdf.fmw

Hi @daveatsafe

So I'm now able to write an image into 3D PDF. I just learned another transformer. Thank you :)

But when I resize the image, it only degrades the quality. Nothing else is happening, as you can see.

This is my workbench, but I put it in attachment.

 


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • November 6, 2019
philippeb wrote:

resizedimageinto3dpdf.fmw

Hi @daveatsafe

So I'm now able to write an image into 3D PDF. I just learned another transformer. Thank you :)

But when I resize the image, it only degrades the quality. Nothing else is happening, as you can see.

This is my workbench, but I put it in attachment.

 

Hi @philippeb,

Whenever an image is created or read into FME, it is is given a georeference to tie it the world. If this cannot be read from the source data, a default georeference is created, with 0,0 at the upper left corner of the image and a pixel size of 1.

Resampling the image will change the number of pixels in the image, but not the georeference location of the image. This is good if you are creating a lower resolution aerial image, since the image corners remain in the same location.

If you want to change the extents of the image as well as the resolution, you can use the Scaler transformer after the RasterResampler, with the X and Y scale factors set to 0.2, and Z Scale left at 1.


philippeb
Enthusiast
Forum|alt.badge.img+18
  • Author
  • Enthusiast
  • November 7, 2019
daveatsafe wrote:

Hi @philippeb,

Whenever an image is created or read into FME, it is is given a georeference to tie it the world. If this cannot be read from the source data, a default georeference is created, with 0,0 at the upper left corner of the image and a pixel size of 1.

Resampling the image will change the number of pixels in the image, but not the georeference location of the image. This is good if you are creating a lower resolution aerial image, since the image corners remain in the same location.

If you want to change the extents of the image as well as the resolution, you can use the Scaler transformer after the RasterResampler, with the X and Y scale factors set to 0.2, and Z Scale left at 1.

A Scaler before FaceReplacer, exactly what I needed! Thanks a lot!!


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