이미지 효과 생성기 Aspose.Imaging for .NET 플러그인

이미지 효과 생성기 Aspose.Imaging for .NET 플러그인

Image Effect Creator .NET Plugin는 개발자가 다양한 효과와 필터로 이미지를 향상할 수 있도록 지원합니다. 이미지를 부드럽게 하거나 밝기, 대비 및 색상 감마와 같은 매개변수를 미세 조정하고자 할 때, 이 플러그인은 이미지 향상을 위한 강력한 도구 역할을 합니다.

주요 기능

  • *고급 필터 다양한 필터를 활용하세요. GaussWiener, BilateralSmoothing, MotionWeiner, GaussianBlur 및 MedianFilter를 포함하여 전문 수준의 이미지 스무딩을 달성합니다.

  • *파라미터 조정 이미지 선명도와 미학을 높이기 위해 밝기, 대비 및 색상 감마를 조정하십시오.

  • 그레이스케일 및 바이너리화 효과 쉽게 그레이스케일, 디더링 및 이진화 효과를 적용하여 독특한 비주얼 스타일을 만드세요.

  • *확장 형식 지원 플러그인은 광범위한 범위의 지원되는 형식 , 이미지 처리에서 다양성을 보장합니다.

  • 워터마크 무료 출력 전체 기능을 잠금 해제하고 처리된 이미지에서 워터마크를 제거하려면 Metered 라이센스를 확보하세요.

어떻게 작동하는지

다음 단계를 따라 이미지를 향상시키세요:

  • Metered 라이센스를 적용하십시오 사용하시기 바랍니다 SetMeteredKey() 공공 키와 개인 암호를 제공하는 방법.

  • 사진을 업로드하고 향상시킵니다

  • 지원되는 형식 목록에서 이미지를 업로드하여 RasterImage 클래스 입니다

  • 선택한 필터 또는 효과를 적용하십시오, 예를 들어, 그레이 스케일 또는 부드러운 필더.

  • 개선된 이미지를 저장하세요 원하는 형식으로 처리된 이미지를 저장하세요.

예제 사용

여기 플러그인을 사용하여 필터와 효과를 적용하는 방법을 보여주는 실용적인 예가 있습니다:

using Aspose.Imaging;
using Aspose.Imaging.Dithering;
using Aspose.Imaging.ImageFilters.FilterOptions;
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
string dataDir = templatesFolder;
Run3();
//------------------------------------------------------------------------------
// Image effect plug-in license use examples
//------------------------------------------------------------------------------
void Run3()
{
// Valid image effect license use example
Metered license = new Metered();
// Only metered plug-in license is supported
license.SetMeteredKey("<your public key>", "<your private key>");
string OutputDirectory = templatesFolder;
if (!Directory.Exists(OutputDirectory))
{
Directory.CreateDirectory(OutputDirectory);
}
string inputFileName = Path.Combine(templatesFolder, "template.png");
ApplyFilter(inputFileName, Path.Combine(OutputDirectory, "licensed_gauss_effect.png"),
new GaussWienerFilterOptions(13, 2)
{
Brightness = 1,
}
);
ApplyFilter(inputFileName, Path.Combine(OutputDirectory, "licensed_bilateral_smoothing.png"),
new BilateralSmoothingFilterOptions());
ApplyFilter(inputFileName, Path.Combine(OutputDirectory, "licensed_gauss_wiener.png"),
new GaussWienerFilterOptions(5, 1.5)
{
Brightness = 1,
Snr = 0.003
}
);
ApplyFilter(inputFileName, Path.Combine(OutputDirectory, "licensed_motion_wiener.png"),
new MotionWienerFilterOptions(10, 1, 0)
{
Brightness = 1,
Snr = 0.007
}
);
ApplyFilter(Path.Combine(templatesFolder, "template.png"), Path.Combine(OutputDirectory, "licensed_gauss_blur.png"),
new GaussianBlurFilterOptions(5, 4));
ApplyFilter(inputFileName, Path.Combine(OutputDirectory, "licensed_gauss_wienere_grayscale.png"),
new GaussWienerFilterOptions(6, 3) { Grayscale = true }
);
ApplyFilter(inputFileName, Path.Combine(OutputDirectory, "licensed_median_effect.png"),
new MedianFilterOptions(4)
);
ApplyImageEffect(inputFileName, Path.Combine(OutputDirectory, "licensed_dithering.png"), doDithering);
ApplyImageEffect(inputFileName, Path.Combine(OutputDirectory, "licensed_binarization.png"), doBinarizeBradley);
ApplyImageEffect(inputFileName, Path.Combine(OutputDirectory, "licensed_grayscale.png"), doGrayscale);
ApplyImageEffect(inputFileName, Path.Combine(OutputDirectory, "licensed_brightness_change.png"), doBrightness);
ApplyImageEffect(inputFileName, Path.Combine(OutputDirectory, "licensed_contrast_change.png"), doContrast);
ApplyImageEffect(inputFileName, Path.Combine(OutputDirectory, "licensed_gamma_change.png"), doGamma);
}
/// <summary>
/// Applies the filter.
/// </summary>
/// <param name="inputFileName">The input file name.</param>
/// <param name="outputFileName">The output file name.</param>
/// <param name="options">The options.</param>
void ApplyFilter(string inputFileName, string outputFileName, FilterOptionsBase options)
{
string inputFilePath = inputFileName;
string outputFilePath = outputFileName;
using (Image image = Image.Load(inputFilePath))
{
RasterImage rasterImage = image as RasterImage;
if (rasterImage == null)
{
return;
}
rasterImage.Filter(image.Bounds, options);
image.Save(outputFilePath);
}
}
void ApplyImageEffect(string inputFileName, string outputFileName, Func<Image, Image> doEffect = null)
{
using (var image = (RasterImage)Image.Load(inputFileName))
{
Image outImage = doEffect(image);
outImage.Save(outputFileName);
}
}
Image doDithering(Image image)
{
var raster = image as RasterImage;
if (raster == null)
{
return null;
}
DitheringMode dithering = new DitheringMode();
dithering.Bits = 1;
dithering.Method = DitheringMethod.ThresholdDithering;
raster.Dither(dithering.Method, dithering.Bits);
return raster;
}
/// <summary>
/// Binarization test.
/// </summary>
Image doBinarizeBradley(Image image)
{
RasterImage rasterImage = image as RasterImage;
if (rasterImage == null)
{
throw new Exception("Image should be the raster image");
}
int threshold = -2;
if (threshold != -1 && threshold != -2)
{
byte b = (byte)threshold;
rasterImage.BinarizeFixed(b);
}
else if (threshold == -2)
{
rasterImage.BinarizeBradley(threshold);
}
else
{
rasterImage.BinarizeOtsu();
}
return rasterImage;
}
/// <summary>
/// Grayscale test.
/// </summary>
Image doGrayscale(Image image)
{
RasterImage rasterImage = image as RasterImage;
if (rasterImage == null)
{
throw new Exception("Image should be the raster image");
}
rasterImage.Grayscale();
return rasterImage;
}
/// <summary>
/// Brightness test.
/// </summary>
Image doBrightness(Image image)
{
RasterImage rasterImage = image as RasterImage;
if (rasterImage == null)
{
throw new Exception("Image should be the raster image");
}
int brightness = 70;
rasterImage.AdjustBrightness(brightness);
return rasterImage;
}
/// <summary>
/// Contrast test.
/// </summary>
Image doContrast(Image image)
{
RasterImage rasterImage = image as RasterImage;
if (rasterImage == null)
{
throw new Exception("Image should be the raster image");
}
int contrast = 80;
rasterImage.AdjustContrast(contrast);
return rasterImage;
}
/// <summary>
/// Gamma test.
/// </summary>
Image doGamma(Image image)
{
RasterImage rasterImage = image as RasterImage;
if (rasterImage == null)
{
throw new Exception("Image should be the raster image");
}
float gamma1 = 3;
rasterImage.AdjustGamma(gamma1);
return rasterImage;
}

무료 온라인 이미지 효과 도구를 탐색

그것의 특징을 시도해 보세요. ASPOSE.Imaging 사진 필터 앱 , 무료 온라인 도구는 설치 또는 암호화가 필요없이 이미지에 효과와 필터를 적용 할 수 있습니다. .NET 이미지 처리 라이브러리의 기능에 대한 훌륭한 소개입니다.

.NET 이미지 조작에 더 깊이 몰입하려는 개발자를 위해, 우리의 ASPOSE.Imaging .NET 플러그인 튜토리얼 여기에서 .NET에 이미지 효과를 추가, 이미지 최적화 및 더 많은 것에 대한 고급 기술에 대해 배울 수 있습니다.

 한국어