Вопрос

I am looking for an advice how to resize an image using libpng in C. I have already written a function, which makes png image from the structure. I want to make my image bigger: for example 1 pixel is extended to 9 pixels (3x3). Is there any function which would be able to do that?

Это было полезно?

Решение

No, libpng is an I/O library that deals with reading and writing the PNG image format.

Resizing an image has nothing to do with any on-disk file format, it's a pure image operation that generally happens in-memory.

You should look at some general-purpose image-processing library, or just do it yourself. The particular resize you mention is easy enough, just read a single pixel and write it 9 times to the output. Then use libpng's functions to save the new image.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top