I am using ImageMagick's convert to convert a bunch of .fits files (an image format used in astronomy) to an animated .gif. My astronomical images are pretty low resolution (150 x 300 pixels) but convert seems to make images that are larger than 150 x 300 pixels and then interpolates to figure out "appropriate" values for the newly created pixels.

I, however, want an accurate presentation of my original .fits images, low resolution and all. What do I need to give to convert so that it doesn't perform any interpolation at all? I don't necessarily care about the resolution/size of the final image (though it should be some size of 150 x 300), I just want the same pixel-to-pixel crispness my original astronomical image has to remain.

I know I've done this before, I just can't remember how.

Here is a screenshot of the original image: enter image description here

And here is the converted image (generated with convert <input>.fits <out>.gif): enter image description here

  • Please add your convert command line. Otherwise we don't know why convert would scale your image.
    – Ned64
    Mar 28, 2018 at 18:37
  • Your example converted image is exactly 300x150 pixels. What do you mean, it is scaled? Could it be your image display program?
    – Ned64
    Mar 28, 2018 at 18:39
  • @Ned64, silly me for not doing that. I have included it. Mar 28, 2018 at 18:39
  • @Ned64, it could be an image display thing I guess. In that case, how would I create a blown-up version of my image that doesn't interpolate for the newly generated pixels? Mar 28, 2018 at 18:41
  • Please run the file command on your output file and post the output (hopefully it will tell us the resolution).
    – Ned64
    Mar 28, 2018 at 18:41

1 Answer 1


You can use the scale option to convert:

convert -scale 400% input.fits scaled.gif

This will not interpolate pixels by default if given an integer scale factor (i.e. n * 100%, n being an integer).

(Please note that this may make also the image significantly larger on disk without any information being added.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .