This was coded with C# initially for Unity3D and then adapted for C#.net due to low dependency on Unity.
It can be compiled with .net sdk 5 using dotnet build
or dotnet run
in the my-app folder throught the command line.
It builds a command line application that scales a preexisting image and saves the scaled image either as one bigger image or as several chunks with the same size as the original image.
This is one module of a series used on Unity3D to generate island meshes. Other modules adapted for C#.net can be seen in the following links:
The following modules use Unity
(more links will be added as soon as the modules are ported onto C#.net or made presentable in Unity).
The full Unity Project can be followed here
This module scales the image by doubling its size a given number of times. The maximum number of times it may be at once has been set to 4 resulting in an image 256 times (16x16) larger than the initial one.
It is based off of the original HQx filter and the code used as reference can be found here. The main difference is that the resulting image uses only the colors available in the original image with the purpose of smoothing its borders between colors.
The results of scaling an image up using this method can be seen in the immages available in the following table:
Base image | saved as a | saved as |
---|---|---|
Scaled 2x | single image | multiple images |
Scaled 4x | single image | multiple images |
Scaled 8x | single image | |
Scaled 16x | single image | multiple images |
Another example in the following images:
- Base image (full image + zoomed to a specific area)
- Image scaled 16x (full image + zoomed to the same area)