2. Detail refinement#

ImageSDK provides control of clarity, noise, and sharpness.

#include "P1Image.hpp"
#include <iostream>

using namespace P1::ImageSdk;

int main()
{
    try
    {
        // 1. Load IIQ image
        RawImage im("Sample.IIQ");

        // 2. Set convert parameters
        ConvertConfig config;

        // Eliminate noise
        config.SetColorNoiseReductionAmount(0.5);
        config.SetLuminanceNoiseReductionAmount(0.5);
        config.SetNoiseReductionSinglePixelEnabled(true);

        // Increase clarity
        config.SetClarity(0, 0.5);

        // Increase sharpness
        config.SetSharpening(1.8, 1.0, 1.0);


        // 3. Convert
        BitmapImage bmp = im.Convert(config);

        // 4. Export to JPEG
        JpegConfig jpegConfig;
        JpegWriter("out.jpeg", bmp, im, jpegConfig);
    

        return 0;
    }
    catch (const std::exception& e)
    {
        std::cerr << e.what();
        return -1;
    }
}

 
using P1.ImageSdk;


// 1. Load IIQ
RawImage im = new("Sample.IIQ");

// 2. Set convert parameters
ConvertConfig config = new();

// Eliminate noise
config.SetColorNoiseReductionAmount(0.5f);
config.SetLuminanceNoiseReductionAmount(0.5f);
config.SetNoiseReductionSinglePixelEnabled(true);

// increase clarity
config.SetClarity(0, 0.5f);

// increase sharpness
config.SetSharpening(1.8f, 1.0f, 1.0f);

// 3. Convert
IBitmapImage bmp = im.Convert(config);

// 4. Export to JPEG
im.WriteAsJpeg("out.jpeg", bmp, new JpegConfig());

Noise reduction removes unwanted artifacts caused by electronic noise or insufficient lighting.

Clarity changes the level of detail in an image. Increased detail leads to sharper edges and a more visually appealing appearance. ImageSDK offers three clarity modes:

  • Neutral: default selection

  • Punch: higher vibrancy in color

  • Natural: preserves highlight

Sharpening utilizes unsharp masking technique to enhance micro details. While similar to clarity, it specifically focuses on controlling micro details when viewing the image up close.