In most case, performing 2x magnification two times is different from performing 4x magnification one times.
![imagemagick php imagemagick php](https://blog.runcloud.io/wp-content/uploads/2020/05/runcloud-imagemagick-php-extension-imagick-1024x522.png)
Most of them only support 2x magnification.
![imagemagick php imagemagick php](https://blog.runcloud.io/wp-content/uploads/2020/05/runcloud-imagemagick-03-verifying-imagick-installation.png)
Noted: Not every pixel art scaling algorithms have 3x and 4x magnification feature. So the option can be something like this example magick -magnify 2x hq image_in.png image_out.png for 2 times magnification by using Hq filter, or magick -magnify 4x xbr image_in.png image_out.png for 4 times magnification by using xBR filter. It is in C# and GPL licensed, but still worth to become reference just don't forget to credits Hawkynt the author of this project.Ībout new -pixel-art-scale type option that you mentioned, I think it is better to use -magnify option as bassically every pixel art works in same way by magnifying image 2 times, 3 times, or 4 times. Just for information, instead of visiting website for every specific pixel art scaling algorithm, it is better to visiting 2DImageFilter website at as reference, because it was the only project that I know which collecting and sometimes improving almost all open source pixel art scaling algorithm that was available. In the mean-time we need to finish up our work on IMv7 -channel-fx and read / write masks. We might support additional pixel art scaling algorithms in the future with a new option, perhaps -pixel-art-scale type.
Imagemagick php free#
If there are some questions from developer regarding this algorithm, feel free to ask and I will try my best to provide the informations. This site also provide stand alone application, so we can see how the algorithm works.Īs the conclusion, I want to said that I and maybe another users will be more than happy if ImageMagick developers want to implement these pixel art scaling algorithms in ImageMagick as these algorithms have many potential to be used outside emulator program to be applicated in real image manipulation implementations. My suggestion is, please visit the main site first then see their sample library at the number four ( ), because it was the only project that I know which tried to unifying and even improving these algorithm outside emulator project (unfortunately it was GPL and implemented in C Sharp). The author of this site (Hawkynt) is very gracious as he always reply my private message regarding his software.
Imagemagick php code#
Almost all pixel art scaling algorithm : Main site, Source code collections. Hqnx : Main site, Source Code or Source Code with support transparency ģ. Super Eagle and Super2xSaI : Main site Ģ. The implementation of these pixel art scaling algorithms can be found in following websites:ġ. The image will looks perfectly with this method. So the solution is by using - let's say - Hq4x filter to magnify it until 8x8 pixel, then shrink it with lanczos filter to 7x7 pixel. For example, a pixel art image with dimension 2x2 pixel want to be scaled until 7x7 pixel (almost 4 times of its original size). The solution when users want to resize their picture with custom size is to magnify the picture with the pixel art scaling algorithms first, then shrink it with lanczos or another filter to the desired size. The limitation of these pixel art algorithm are they only capable for magnifying picture in predefined size, such as 2x, 3x, or 4x and cannot be used to shrink images. I don't want to say that Lanczos or another filter is worse than Pixel Art filter, but it just doesn't suitable for pixel art. If you want to exam more deeply, there is almost no additional color in this image when using this pixel scaling algorithm while in Lanczos or even the patented Genuine Fractals there are too many additional colors even though the quality is still inferior. xBR (NoBlend) (Unique Color: 4, Size: 2.16 kilobytes)Īs you can see, when using pixel art scaling algorithm such as Hqx and xBR the image can be magnified eight times while maintaining it's quality. Hqx (Unique Color: 63, Size: 4.02 kilobytes)Ħ. Portrace (Inkscape) (Unique Color: 1274, Size: 12.76 kilobytes)ĥ. Genuine Fractals (Unique Color: 17150, Size: 41.67 kilobytes)Ĥ. Lanczos (Unique Color: 15278, Size: 38.69 kilobytes)ģ.
![imagemagick php imagemagick php](https://imagemagick.org/image/logo.png)
Nearest Neighbour (Unique Color: 4, Size: 950 bytes)Ģ. Original (Unique Color: 4, Size: 380 bytes)ġ. The purpose of these filters are not too different from another scaling filters, but these filters are specially designed for magnifying pixel art image without visually loss of qualities. But I hope ImageMagick developers will add some filter called pixel-art scalling algorithm, such as SuperEagle, Super2xSaI, Hqx, xBR, etc that was already used in many video game emulators. In ImageMagick, there are many image scaling filters that are already implemented. I'm a new ImageMagick user and very impressive about how ImageMagick work.