# scaling is reducing size of image

**URL:** <https://discourse.itk.org/t/scaling-is-reducing-size-of-image/3591>\
**Category:** Algorithms\
**Tags:** simpleitk, python\
**Created:** [November 3, 2020, 9:39am UTC](https://discourse.itk.org/t/scaling-is-reducing-size-of-image/3591 "2020-11-03T09:39:45Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)\
**Post date:** [November 3, 2020, 3:10pm UTC](https://discourse.itk.org/t/scaling-is-reducing-size-of-image/3591/3 "2020-11-03T15:10:25Z")

</div>

Hello @prms,

Please see reply to your [related question](https://discourse.itk.org/t/help-in-applying-rotation-using-affinematrix/3592/2).

I suspect you are confusing things between number of pixels and physical size of an image. The resampling code below doesn’t change the size of the image, it just maps the voxels from [x,y,z] to [2x,2y,2z] so the image looks smaller but the whole image remained the same size.

```auto
import SimpleITK as sitk

img = sitk.GaussianSource()
sitk.Show(img, 'original image')
print(img.GetSize())

tx = sitk.AffineTransform(3)
tx.SetMatrix([2,0,0,0,2,0,0,0,2])

resampled_img = sitk.Resample(img,tx,defaultPixelValue=255)
sitk.Show(resampled_img, 'resampled image')
print(resampled_img.GetSize())

```

---

_[View the full topic](https://discourse.itk.org/t/scaling-is-reducing-size-of-image/3591)._
