Linear transformation of an image without specifying Resampler with SixLabours ImageSharp library

30 Views Asked by At

I am trying to resize an image without involving a Resampler algorithm in the process.

E.g.: I have a square image 30x30 px. I would like to resize it to 300x300px. In the resized image, in the place of each pixel, there should be a solid square with dimensions 10x10px, with the color of the original pixel. I presume I should mutate the image by transforming it instead of resizing it:

var loadedImage = await Image.LoadAsync<Rgba64>(filePath);
loadedImage.Mutate(i => i.Transform(...))

but I am not sure how to achieve this.

Of course I can build a new image manually, by using solid rectangles, but I was hoping for a cleaner, simpler and an automatic way.

Any ideas how to configure either Transform or Resize function on the image context?

0

There are 0 best solutions below