![]() ![]() It also removes any embedded color profiles to reduce the filesize of the thumbnails. thumbnail works just like -resize does, with a few differences: It uses by default data-dependent triangulation when resizing (unless the resize method is overridden by additionally specifying -filter ).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. When magnifying, it simply replicates the respective input pixels for the required additional pixels. When minifying, it changes the image size simply by replacing pixel colors by averaging the respective input pixel colors together. It also completely ignores any current -filter setting. scale 400x300 produces the equivalent result (but is faster, because it avoids all the filter processing) as does using -filter box -resize 400x300. 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. 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). 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. 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. resample uses as parameter the desired XxY resolution, not not the XxY pixel geometry of the target image. 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. ![]() 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. The output will never have more (different) colors than the input image had it may have fewer colors though. The geometry argument to -sample doesn't support any offset part (unlike -resize, which respects offset directives for the output). 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. When magnifying (because the input image size may be smaller than 400x300), pixels are replicated in blocks. sample does not support the additional setting of -filter if set anyway, then -filter is simply ignored. However, there are a few very important differences to -resize: sample 400x300 converts an input image to an output images which has the pixel dimensions of 400x300. 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). filter point -resize 400x300 creates exactly the same result as -sample 400x300 does, but it runs still a bit slower. 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.įor a list of supported filters, simply run convert -list filter. resize does support an additional setting of -filter (which should occur on the commandline before using -resize!). Additionally, there are a few more differences to -scale: It also shifts the output by 20 pixels to the right and by 30 pixels to the bottom. 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. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |