Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void processImage(const char* inputFilename, const char* outputFilename, float sigma)
- {
- // Load the input image
- std::vector<unsigned char> image;
- unsigned int width, height;
- unsigned error = lodepng::decode(image, width, height, inputFilename);
- if (error)
- {
- std::cerr << "Error decoding PNG: " << lodepng_error_text(error) << std::endl;
- return;
- }
- // Apply the Gaussian blur filter
- gaussianBlur(image.data(), width, height, 4, sigma);
- // Save the output image
- error = lodepng::encode(outputFilename, image, width, height);
- if (error)
- {
- std::cerr << "Error encoding PNG: " << lodepng_error_text(error) << std::endl;
- return;
- }
- std::cout << "Image processed successfully!" << std::endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement