Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Collection of basic image processing algorithms for processing

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
license.txt
NotificationsYou must be signed in to change notification settings

Milchreis/processing-imageprocessing

Repository files navigation

This library collects various image processing algorithms and provides simple access to them. All algorithms are implementedin Java and runs without any other dependencies. Some algorithms are pretty standard and others maybe do you know from Photoshop.It starts with less basic features and grow over the last years.If you need high power performance better useopencv for processing.

If you like this project and you want to keep me awake 🤪

Buy Me a Coffee at ko-fi.com

Installation

If you want to use this library in your processing sketch you can download it via the integratedContribution Manager.

alt install

Examples

Overview

The following algorithms are supported in this library. Click on the link to see an example image and a code snippet.

Original image

alt original

Photo taken by memore here

Basics

Grayscale image

alt grayscale

PImageprocessedImage =Grayscale.apply(image);

Flip image

alt flip

PImageprocessedImage =Flip.apply(image,horizontal,vertical);// horizontal and vertical are boolean

Invert colors

alt invert colors

// invertRed, invertGreen and invertBlue are booleanPImageprocessedImage =InvertColors.apply(image,invertRed,invertGreen,invertBlue);

Threshold image

alt threshold

PImageprocessedImage =Threshold.apply(image);// Auto thresholdPImageprocessedImage =Threshold.apply(image,value);// Threshold value between 0 and 255

Dilation image

alt dilation

PImageprocessedImage =Dilation.apply(image,radius);// radius is a positive number

Erosion image

alt erosion

PImageprocessedImage =Erosion.apply(image,radius);// radius is a positive number

Vignette image

alt vignette

// intensity and vignetteWidth are floats between 0.0 and 1.0PImageprocessedImage =Vignette.apply(image,intensity,vignetteWidth);

Quantization

alt quantization

PImageprocessedImage =Quantization.apply(image,shades);// shades is a positive number between 1 and 255

PaletteMapping

alt quantization

PImageprocessedImage =PaletteMapping.apply(image,color1,color2,color3);// Add any number of colors from dark to light

Difference

alt difference

// difference is a float between 0.0 and 1.0 from less to very differentfloatdifference =Comparison.howDifferent(image1,image2);// differenceImage is the difference between the pixel values (black is no difference, white is high difference)PImagedifferenceImage =Comparison.calculateDifferenceImage(image1,image2);

Blur

Gaussian blur image

alt gaussian

PImageprocessedImage =Gaussian.apply(image,7,0.84089642);// kernel size and sigma

Pixelize image

alt pixelation

// pixelsize is a positive numberPImageprocessedImage =Pixelation.apply(image,pixelsize);// Pixelize a sub area of the input imagePImageprocessedImage =Pixelation.apply(image,pixelsize,subX,subY,subWidth,subHeight);

Tilt-Shift-Effect

alt tilt-shift

PImageprocessedImage =TiltShift.apply(image,blurIntensity,horizontal,position,sharpWideness);

Edge detection

Canny's algorithm

alt canny-edge

PImageprocessedImage =CannyEdgeDetector.apply(image);

Sobels algorithm

alt sobel-edge

PImageprocessedImage =SobelEdgeDetector.apply(image);// for colored sobel (for each color channel)PImageprocessedImage =SobelEdgeDetector.apply(image,false);

Optimisation

Brightness

alt autobalance

PImageprocessedImage =Brightness.apply(image,value);// value isa positive number for brighting up or a negative for darken down

Contrast

alt contrast

// intensity is between -1.0 and 1.0PImageprocessedImage =Contrast.apply(image,intensity);

Saturation

alt saturation

// intensity is between 0.0 and 10.0// 0.0 to 1.0 decreases and all above increases the saturationPImageprocessedImage =Saturation.apply(image,intensity);

Changing highlights

alt changing highlights

// intensity between -1.0 and 1.0PImageprocessedImage =Lights.apply(image,intensity);

Changing shadows

alt changing shadows

// intensity between -1.0 and 1.0PImageprocessedImage =Shadows.apply(image,intensity);

AutoBalance image

alt autobalance

PImageprocessedImage =AutoBalance.apply(image);

Bloom image

alt bloom

PImageprocessedImage =Bloom.apply(image,intensity);// intensity between 0 and 255

Sharpen image

alt sharpen

PImageprocessedImage =Sharpen.apply(image,sharpIntensity);// sharpIntensity between 0.0 and 10.0

Color shift image

alt color shift

// hue is a value between 0 and 360// offset is the color range which is accepted (in hue range)// shift is the number of the subtracted or added hue valuePImageprocessedImage =ColorShift.applyHue(image,hue,offset,shift);// or short: ColorShift.apply(image, hue, offset, shift)PImageprocessedImage =ColorShift.applySaturation(image,hue,offset,shift);PImageprocessedImage =ColorShift.applyBrightness(image,hue,offset,shift);

Looks

Lookup table image

alt lookup-table

LUTstyle =LUT.loadLut(LUT.STYLE.CONTRAST);PImageprocessedImage =LUT.apply(image,style);

RetroConsole effect (Gameboy)

alt lookup-table

PImageprocessedImage =RetroConsole.applyGameboy(image,pixelSize);

Glitch image

alt glitch-effect

PImageprocessedImage =Glitch.apply(image,intensity,scanlineheight);

Matte effect

alt matte-effect

PImageprocessedImage =Matte.apply(image,matteIntensity,// intensity for the lifting blacks between 0 and 255contrastIntensity,// intensity for the constrast between 0 and 255saturationIntensity);// change for the saturation between -0.5 and 0.5

Sabattier effect

alt sabattier-effect

// intensity between 0.0 and 1.0PImageprocessedImage =Sabattier.apply(image,intensity);PImageprocessedImage =Sabattier.applyRed(image,intensity);PImageprocessedImage =Sabattier.applyGreen(image,intensity);PImageprocessedImage =Sabattier.applyBlue(image,intensity);

Strokes image

random anglesfixed angle
alt strokesalt strokes
PImageprocessedImage =Strokes.apply(image,gridSize,lineLength);PImageprocessedImage =Strokes.apply(image,gridSize,// is positive and the area for compound pixelslineLength,// is positive and the length in pixels for each linelineWeight,// is positive and the weight of each line in pixellinesPerGrid,// the number of lines per gridlineIntensity,// alpha value for each line between 0 and 255degree,// if set the rotation is fixed in degree, otherwise randominColor,// true for colors else black and whitebackgroundColor);// color for the background

Dithering

alt dithering

// default dithering algorithm is BAYER_4x4PImageprocessedImage =Dithering.apply(image);// change algrithm: BAYER_2x2, BAYER_4x4, BAYER_8x8PImageprocessedImage =Dithering.apply(image,Dithering.Algorithm.BAYER_8x8);// use a curstom kernel (kernel = float[])PImageprocessedImage =Dithering.aapply(PImageimage,kernel);

Halftone image

alt halftone

PImageprocessedImage =Halftone.apply(image,dotsize);// dot size in pixelPImageprocessedImage =Halftone.apply(image,dotsize,grid);// grid = true, on false honeycomb stylePImageprocessedImage =Halftone.apply(image,dotsize,foreground,background);// background and foreground colorsPImageprocessedImage =Halftone.apply(image,dotsize,foreground,background,grid);PImageprocessedImage =Halftone.apply(image,dotsize,foreground,background,spacing,grid);// size between dots in pixels

Toning image

alt toning

// tone is a color and intensity is a value between 0.0 and 1.0colortone =color(255,11,120);floatintensity =0.8f;PImageprocessedImage =Toning.apply(image,tone,intensity);

Split toning image

alt split-toning

PImageprocessedImage =SplitToning.apply(image,highlightTone,// Color for highlighs (f.e. color highlightTone = color(211, 180, 21);intensityHighlights,// intensity for the toning in highlights between 0.0 and 1.0shadowTone,// Color for the shadows (f.e. color shadowTone = color(124, 32, 201);intensityShadows);// intensity for the toning in the shadows between 0.0 and 1.0

Sine-Wave image

alt sine-wave

PImageprocessedImage =SineWave.apply(image,rowHeight,weight,backgroundColor,wavesColor);

Knitting image

alt knitting

// keeps the original colorsPImageprocessedImage =Knitting.apply(image,size);// Sets foreground and background color and uses a thresholdPImageprocessedImage =Knitting.apply(image,size,threshold,240, #EE0000);

ASCII image

alt ascii

PImageprocessedImage =ASCII.apply(image);// characterset = ASCII.SHORT_SET or ASCII.LONG_SET, another String from black to whitePImageprocessedImage =ASCII.apply(image,characterset);PImageprocessedImage =ASCII.apply(image,characterset,fontSize);// fontSize is an integerPImageprocessedImage =ASCII.apply(image,characterset,fontSize,foregroundColor,backgroundColor,toneInColor);// To get the ASCII image as plain string use the following methodPImageprocessedImage =ASCII.getAsciiText(image);

Miscellaneous

Stacked images

alt stacked

// Add so many images in the end as you needPImageprocessedImage =Stacker.apply(Stacker.ALGORITHM.AVERAGE,image1,image2);PImageprocessedImage =Stacker.apply(Stacker.ALGORITHM.MEDIAN,image1,image2);

Blending two images

alt blending

// intensity is a float between 0.0 and 1.0PImageprocessedImage =Blend.apply(image1,image2,intensity);

Special thanks

My special thanks goes toavatarr for implementing andpublishing basic algorithms. Also thank you very much Tom Gibara for your great blog post and the implementation ofthecanny edge detector.

Moreover I thank youJoseph HENRY for the Sine-Wave-effect code anduheinema for the Sabattier code in theProcessing Discourse.

About

Collection of basic image processing algorithms for processing

Topics

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
license.txt

Stars

Watchers

Forks

Sponsor this project

    Packages

    No packages published

    [8]ページ先頭

    ©2009-2025 Movatter.jp