Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8740749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:11:06+00:00 2026-06-13T11:11:06+00:00

I found multiple ways to change the resolution of an image using convert :

  • 0

I found multiple ways to change the resolution of an image using convert:

-sample
-resample
-scale
-resize
-adaptive-resize
-thumbnail

What’s the difference of those?

If I need to make various size large picture thumbnail with fixed aspect ratio (cropping needed) — what’s my best choice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:11:07+00:00Added an answer on June 13, 2026 at 11:11 am

    resize

    -resize 400x300+20+30 (like the -scale and -sample examples below) converts an input to an output image which has the pixel dimensions of 400x300. It also shifts the output by 20 pixels to the right and by 30 pixels to the bottom. Additionally, there are a few more differences to -scale:

    • -resize does support an additional setting of -filter (which should occur on the commandline before using -resize!).

    • -filter determines the exact algorithm to be used for the colors of added pixels in the case of magnification, or for the colors to be used for the remaining pixels when some of their neighbors are removed in case of minification.

    • For a list of supported filters, simply run convert -list filter.

    • -filter point -resize 400x300 creates exactly the same result as -sample 400x300 does, but it runs still a bit slower.

    • If not set alongside (before) -resize, the conversion will silently default to -filter Lanczos which is slower, but which generates a much better quality (because it takes into account the colors of all surrounding pixels for any newly added ones) than -filter point produces (which uses the nearest neighbor rule to determine the color of a newly added pixels).

    sample

    -sample 400x300 converts an input image to an output images which has the pixel dimensions of 400x300. However, there are a few very important differences to -resize:

    • -sample does not support the additional setting of -filter; if set anyway, then -filter is simply ignored.

    • When magnifying (because the input image size may be smaller than 400x300), pixels are replicated in blocks.

    • When minifying (because the input image size may be larger than 400x300), pixels are sub-sampled with a very simple algorithm: some rows and columns are simply skipped over.

    • The geometry argument to -sample doesn’t support any offset part (unlike -resize, which respects offset directives for the output).

    • The output will never have more (different) colors than the input image had; it may have fewer colors though.

    • Therefore -sample is very fast (faster than -resize) — but output quality is (usually) worse: you can easily get extreme blocking and aliasing effects in the resulting output.

    • One important feature of -sample is that the new image will not contain any new colors, though some colors from the original image may disappear.

    resample

    -resample uses as parameter the desired XxY resolution, not not the XxY pixel geometry of the target image. The purpose of this operator is to preserve the rendered size of an image: Assume your image measures 4 inches by 3 inches on a device that renders it at 300 DPI. Then asking for a -resample 72 or -resample 72x72 will resize the image so that it measures (again) 4 inches by 3 inches on a 72 DPI device.

    • This operation works only for such images which already have a desired resolution stored in their metadata (not all image formats do support the concept of an image resolution — JPEG, PNG and TIFF do).

    • If the source image is in a format where internal support for an image resolution is missing, then the (assumed) original resolution of the image must be specified via -density on the command line prior to specifying the -resample resolution.

    scale

    -scale 400x300 produces the equivalent result (but is faster, because it avoids all the filter processing) as does using -filter box -resize 400x300. It also completely ignores any current -filter setting.

    • When minifying, it changes the image size simply by replacing pixel colors by averaging the respective input pixel colors together.

    • When magnifying, it simply replicates the respective input pixels for the required additional pixels.

    adaptive-resize

    -adaptive-resize 400x300 does not support (or does ignore, if set) the offset part of a geometry parameter and also ignores the -gravity setting if present.

    • It uses by default data-dependent triangulation when resizing (unless the resize method is overridden by additionally specifying -filter [something]).

    thumbnail

    -thumbnail works just like -resize does, with a few differences:

    • It is optimized for speed.

    • It also removes any embedded color profiles to reduce the filesize of the thumbnails.


    The following answer shows a few (illustrated!) examples of the -resize directive. Each illustration shows a different result, depending on the ‘fine details’ of the exact resize method:

    • ImageMagick crop command not giving perfect result
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to crop an image. I have found multiple ways to do
I'm using the jQuery multi-file upload plugin found here: http://www.fyneworks.com/jquery/multiple-file-upload/ I don't see in
Okay everyone, I have found multiple ways of doing this and I have even
I found this post that shows how to pass multiple check box selections to
I have recently found out that no argument constructor and multiple argument constructor cannnot
I found something that works with updating one field at here: http://www.karlrixon.co.uk/articles/sql/update-multiple-rows-with-different-values-and-a-single-sql-query/ UPDATE person
I have used multiple activities to handle mutiple views in android . I found
I've tried a few Asus Ones, and found that even switching between multiple windows
I'm currently using register_shutdown_function() for multiple purposes. One use is for handling fatal errors,
Is it confusing to design an API with multiple ways of achieving the same

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.