diff --git a/build.xml b/build.xml
new file mode 100644
index 0000000..20c8112
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+ Builds, tests, and runs the project ImageApplication.
+
+
+
diff --git a/build/classes/.netbeans_automatic_build b/build/classes/.netbeans_automatic_build
new file mode 100644
index 0000000..e69de29
diff --git a/build/classes/Effects/AutoBrighten.class b/build/classes/Effects/AutoBrighten.class
new file mode 100644
index 0000000..65de62b
Binary files /dev/null and b/build/classes/Effects/AutoBrighten.class differ
diff --git a/build/classes/Effects/AutoColor.class b/build/classes/Effects/AutoColor.class
new file mode 100644
index 0000000..c9ad54b
Binary files /dev/null and b/build/classes/Effects/AutoColor.class differ
diff --git a/build/classes/Effects/AutoContrast.class b/build/classes/Effects/AutoContrast.class
new file mode 100644
index 0000000..4efbd3e
Binary files /dev/null and b/build/classes/Effects/AutoContrast.class differ
diff --git a/build/classes/Effects/BlueAdjust.class b/build/classes/Effects/BlueAdjust.class
new file mode 100644
index 0000000..2662d75
Binary files /dev/null and b/build/classes/Effects/BlueAdjust.class differ
diff --git a/build/classes/Effects/Brighten.class b/build/classes/Effects/Brighten.class
new file mode 100644
index 0000000..7cb11e0
Binary files /dev/null and b/build/classes/Effects/Brighten.class differ
diff --git a/build/classes/Effects/Contrast.class b/build/classes/Effects/Contrast.class
new file mode 100644
index 0000000..fc4892b
Binary files /dev/null and b/build/classes/Effects/Contrast.class differ
diff --git a/build/classes/Effects/ConvoEffect.class b/build/classes/Effects/ConvoEffect.class
new file mode 100644
index 0000000..236b1b2
Binary files /dev/null and b/build/classes/Effects/ConvoEffect.class differ
diff --git a/build/classes/Effects/DustFilter.class b/build/classes/Effects/DustFilter.class
new file mode 100644
index 0000000..cce8f4b
Binary files /dev/null and b/build/classes/Effects/DustFilter.class differ
diff --git a/build/classes/Effects/Effects.class b/build/classes/Effects/Effects.class
new file mode 100644
index 0000000..3bc5d70
Binary files /dev/null and b/build/classes/Effects/Effects.class differ
diff --git a/build/classes/Effects/Granulate.class b/build/classes/Effects/Granulate.class
new file mode 100644
index 0000000..6309e2c
Binary files /dev/null and b/build/classes/Effects/Granulate.class differ
diff --git a/build/classes/Effects/GreenAdjust.class b/build/classes/Effects/GreenAdjust.class
new file mode 100644
index 0000000..a330919
Binary files /dev/null and b/build/classes/Effects/GreenAdjust.class differ
diff --git a/build/classes/Effects/GreyScale.class b/build/classes/Effects/GreyScale.class
new file mode 100644
index 0000000..a0f291a
Binary files /dev/null and b/build/classes/Effects/GreyScale.class differ
diff --git a/build/classes/Effects/Hue.class b/build/classes/Effects/Hue.class
new file mode 100644
index 0000000..0fc6844
Binary files /dev/null and b/build/classes/Effects/Hue.class differ
diff --git a/build/classes/Effects/Invert.class b/build/classes/Effects/Invert.class
new file mode 100644
index 0000000..467d374
Binary files /dev/null and b/build/classes/Effects/Invert.class differ
diff --git a/build/classes/Effects/Posterize.class b/build/classes/Effects/Posterize.class
new file mode 100644
index 0000000..82a9108
Binary files /dev/null and b/build/classes/Effects/Posterize.class differ
diff --git a/build/classes/Effects/RedAdjust.class b/build/classes/Effects/RedAdjust.class
new file mode 100644
index 0000000..b620d7f
Binary files /dev/null and b/build/classes/Effects/RedAdjust.class differ
diff --git a/build/classes/Effects/Saturation.class b/build/classes/Effects/Saturation.class
new file mode 100644
index 0000000..5cc6be9
Binary files /dev/null and b/build/classes/Effects/Saturation.class differ
diff --git a/build/classes/Effects/Sharpen.class b/build/classes/Effects/Sharpen.class
new file mode 100644
index 0000000..8aa2570
Binary files /dev/null and b/build/classes/Effects/Sharpen.class differ
diff --git a/build/classes/Effects/Treshold.class b/build/classes/Effects/Treshold.class
new file mode 100644
index 0000000..e4d7a3b
Binary files /dev/null and b/build/classes/Effects/Treshold.class differ
diff --git a/manifest.mf b/manifest.mf
new file mode 100644
index 0000000..328e8e5
--- /dev/null
+++ b/manifest.mf
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml
new file mode 100644
index 0000000..2f1c40f
--- /dev/null
+++ b/nbproject/build-impl.xml
@@ -0,0 +1,642 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set src.dir
+ Must set test.src.dir
+ Must set build.dir
+ Must set dist.dir
+ Must set build.classes.dir
+ Must set dist.javadoc.dir
+ Must set build.test.classes.dir
+ Must set build.test.results.dir
+ Must set build.classes.excludes
+ Must set dist.jar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To run this application from the command line without Ant, try:
+
+
+
+
+
+
+ java -cp "${run.classpath.with.dist.jar}" ${main.class}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To run this application from the command line without Ant, try:
+
+ java -jar "${dist.jar.resolved}"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set debug.class
+
+
+
+
+ Must set fix.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set test.includes
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+ Must select one file in the IDE or set test.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties
new file mode 100644
index 0000000..fb9cb67
--- /dev/null
+++ b/nbproject/genfiles.properties
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=27f586d4
+build.xml.script.CRC32=a3b48cdc
+build.xml.stylesheet.CRC32=958a1d3e
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=27f586d4
+nbproject/build-impl.xml.script.CRC32=db6c7ed3
+nbproject/build-impl.xml.stylesheet.CRC32=e55b27f5
diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties
new file mode 100644
index 0000000..0079df4
--- /dev/null
+++ b/nbproject/private/private.properties
@@ -0,0 +1,3 @@
+compile.on.save=true
+jaxws.endorsed.dir=C:\\Program Files\\NetBeans 6.5\\java2\\modules\\ext\\jaxws21\\api:C:\\Program Files\\NetBeans 6.5\\ide10\\modules\\ext\\jaxb\\api
+user.properties.file=C:\\Users\\Govind\\.netbeans\\6.5\\build.properties
diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml
new file mode 100644
index 0000000..c1f155a
--- /dev/null
+++ b/nbproject/private/private.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/nbproject/project.properties b/nbproject/project.properties
new file mode 100644
index 0000000..5959d39
--- /dev/null
+++ b/nbproject/project.properties
@@ -0,0 +1,61 @@
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/ImageApplication.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+excludes=
+includes=**
+jar.compress=false
+javac.classpath=
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.source=1.5
+javac.target=1.5
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}:\
+ ${libs.junit.classpath}:\
+ ${libs.junit_4.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+main.class=imageapplication.Main
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+platform.active=default_platform
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+run.jvmargs=
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test
diff --git a/nbproject/project.xml b/nbproject/project.xml
new file mode 100644
index 0000000..681c32d
--- /dev/null
+++ b/nbproject/project.xml
@@ -0,0 +1,16 @@
+
+
+ org.netbeans.modules.java.j2seproject
+
+
+ ImageApplication
+ 1.6.5
+
+
+
+
+
+
+
+
+
diff --git a/output.jpg b/output.jpg
new file mode 100644
index 0000000..444e1b3
Binary files /dev/null and b/output.jpg differ
diff --git a/src/Effects/AutoBrighten.java b/src/Effects/AutoBrighten.java
new file mode 100644
index 0000000..bf508a4
--- /dev/null
+++ b/src/Effects/AutoBrighten.java
@@ -0,0 +1,60 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package Effects;
+
+/**
+ *
+ * @author Govind
+ */
+public class AutoBrighten implements Effects{
+private int increase;int normal=150; int approach=20;
+
+public AutoBrighten() {}
+public AutoBrighten(int n,int a)
+{normal=n;approach=a;}
+ public void Filter(int[] pixels, int width, int height, int sliderval) {
+
+ int sum=0;
+
+ int[] histr=new int[256],histg=new int[256],histb=new int[256];
+ for(int i=0;i>16));
+ int green = (0xff & (p>>8));
+ int blue = (0xff & p);
+ histr[red]++;histb[blue]++;histg[green]++;
+ }
+ for(int i=0;i<256;i++){
+sum=sum +i*(histr[i]+histg[i]+histb[i]);
+}
+sum=sum/(width*height);
+int diff=normal-sum;
+increase=diff*approach/100;
+
+ for (int i = 0; i < width * height; i++) {
+ pixels[i] = ProcessPixel(pixels[i]);
+ }
+ }
+
+ public int ProcessPixel(int pixel) {
+
+ int red =(0xff & (pixel>>16));
+ int green = (0xff & (pixel>>8));
+ int blue = (0xff & pixel);
+
+ red+=increase;
+ green+=increase;
+ blue+=increase;
+
+ if (red > 255) red =255;if(red<0) red=0;
+ if (green > 255) green=255;if(green<0) green=0;
+ if (blue >255) blue =255;if(blue<0) blue=0;
+ pixel = (0xff000000 | red << 16 | green <<8 | blue);
+ return pixel;
+ }
+
+
+}
diff --git a/src/Effects/AutoColor.java b/src/Effects/AutoColor.java
new file mode 100644
index 0000000..bd2fc9b
--- /dev/null
+++ b/src/Effects/AutoColor.java
@@ -0,0 +1,75 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package Effects;
+
+/**
+ *
+ * @author Govind
+ */
+public class AutoColor implements Effects{
+
+ private int increase;
+ private float corr,corg,corb;
+ int approach=50;
+
+ public AutoColor() {
+
+ }
+ public AutoColor(int a)
+ {approach=a;}
+ public void Filter(int[] pixels, int width, int height, int sliderval) {
+
+ int normal=128; int sumr=0;int sumg=0;int sumb=0;
+
+ int[] histr=new int[256],histg=new int[256],histb=new int[256];
+ for(int i=0;i<256;i++)
+ {
+ histr[i]=0;
+ histg[i]=0;
+ histb[i]=0;
+ }
+ for(int i=0;i>16));
+ int green = (0xff & (p>>8));
+ int blue = (0xff & p);
+ histr[red]++;histb[blue]++;histg[green]++;
+ }
+ for(int i=0;i<256;i++){
+sumr=sumr +i*histr[i];
+sumg=sumg +i*histg[i];
+sumb=sumb +i*histb[i];
+}
+
+corr=(sumg+sumb)/(1+sumr);
+corg=(sumb+sumr)/(1+sumg);
+corb=(sumr+sumg)/(1+sumb);
+
+ System.out.println(corr);
+System.out.println(corg);
+System.out.println(corb);
+ for (int i = 0; i < width * height; i++) {
+ pixels[i] = ProcessPixel(pixels[i]);
+ }
+ }
+
+ public int ProcessPixel(int pixel) {
+
+ int red =(0xff & (pixel>>16));
+ int green = (0xff & (pixel>>8));
+ int blue = (0xff & pixel);
+
+ red+=(int) (red*corr * approach / 100);
+ green+=(int) (green*corg * approach / 100);
+ blue+=(int) (blue*corb * approach / 100);
+
+ if (red > 255) red =255;if(red<0) red=0;
+ if (green > 255) green=255;if(green<0) green=0;
+ if (blue >255) blue =255;if(blue<0) blue=0;
+ pixel = (0xff000000 | red << 16 | green <<8 | blue);
+ return pixel;
+ }
+ }
diff --git a/src/Effects/AutoContrast.java b/src/Effects/AutoContrast.java
new file mode 100644
index 0000000..af70b8c
--- /dev/null
+++ b/src/Effects/AutoContrast.java
@@ -0,0 +1,83 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package Effects;
+
+/**
+ *
+ * @author Govind
+ */
+public class AutoContrast implements Effects{
+ int normal=128; int approach=50;
+ public AutoContrast(){}
+ public AutoContrast(int n,int a)
+ {normal =n;approach=a;}
+private int mod(int num)
+{
+ int pos;
+ if(num>=0) pos=num;
+ else pos=(-1)*num;
+ return pos;
+}
+private int nearest(int r,int a,int b)
+{
+ if(mod(r-a)>16));
+ int green = (0xff & (p>>8));
+ int blue = (0xff & p);
+ histr[red]++;histb[blue]++;histg[green]++;
+ }
+ for(int i=0;i<256;i++){
+stdevr+=i*(histr[i]-normal);
+stdevg+=i*(histg[i]-normal);
+stdevb+=i*(histb[i]-normal);
+}
+
+stdevr=stdevr/(width*height);
+stdevg=stdevg/(width*height);
+stdevb=stdevb/(width*height);
+int stdev=(stdevr+stdevg+stdevb)/3;
+int span=stdev-nearest(stdev,normal/2,3*normal/2);
+int decrease=span*approach/100;
+
+ for (int i = 0; i < width * height; i++) {
+ pixels[i] = ProcessPixel(pixels[i],decrease);
+ }
+ }
+
+ public int ProcessPixel(int pixel,int decrease) {
+
+ int red =(0xff & (pixel>>16));
+ int green = (0xff & (pixel>>8));
+ int blue = (0xff & pixel);
+
+ red-=decrease;
+ green-=decrease;
+ blue-=decrease;
+
+ if (red > 255) red =255;if(red<0) red=0;
+ if (green > 255) green=255;if(green<0) green=0;
+ if (blue >255) blue =255;if(blue<0) blue=0;
+ pixel = (0xff000000 | red << 16 | green <<8 | blue);
+ return pixel;
+ }
+
+ public int ProcessPixel(int pixel) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+
+}
+
diff --git a/src/Effects/BlueAdjust.java b/src/Effects/BlueAdjust.java
new file mode 100644
index 0000000..b515316
--- /dev/null
+++ b/src/Effects/BlueAdjust.java
@@ -0,0 +1,45 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package Effects;
+
+import Effects.Effects;
+
+/**
+ *
+ * @author Govind
+ */
+public class BlueAdjust implements Effects{
+ private int value;
+
+
+ public void Filter(int pixels[], int width, int height, int sliderval) {
+
+ value = sliderval;
+
+ for (int i = 0; i < width * height; i++) {
+ pixels[i] = ProcessPixel(pixels[i]);
+ }
+
+ }
+
+ public int ProcessPixel(int pixel) {
+ int red = (0xff & (pixel >> 16));
+ int green = (0xff & (pixel >> 8));
+ int blue = (0xff & pixel);
+
+ blue = blue + value;
+
+ if (blue > 255) {
+ blue = 255;
+ }
+ if (blue < 0) {
+ blue = 0;
+ }
+ pixel = (0xff000000 | red << 16 | green << 8 | blue);
+ return pixel;
+ }
+
+}
diff --git a/src/Effects/Brighten.java b/src/Effects/Brighten.java
new file mode 100644
index 0000000..4650b07
--- /dev/null
+++ b/src/Effects/Brighten.java
@@ -0,0 +1,61 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package Effects;
+
+/**
+ *
+ * @author Govind
+ */
+public class Brighten implements Effects {
+
+ private int value;
+
+ public Brighten() {
+ }
+
+
+ public void Filter(int pixels[], int width, int height, int sliderval) {
+
+ value = sliderval;
+
+ for (int i = 0; i < width * height; i++) {
+ pixels[i] = ProcessPixel(pixels[i]);
+ }
+
+ }
+
+ public int ProcessPixel(int pixel) {
+ int red = (0xff & (pixel >> 16));
+ int green = (0xff & (pixel >> 8));
+ int blue = (0xff & pixel);
+
+ red = red + value;
+ green = green + value;
+ blue = blue + value;
+
+ if (red > 255) {
+ red = 255;
+ }
+ if (red < 0) {
+ red = 0;
+ }
+ if (green > 255) {
+ green = 255;
+ }
+ if (green < 0) {
+ green = 0;
+ }
+ if (blue > 255) {
+ blue = 255;
+ }
+ if (blue < 0) {
+ blue = 0;
+ }
+ pixel = (0xff000000 | red << 16 | green << 8 | blue);
+ return pixel;
+ }
+
+
+}
diff --git a/src/Effects/Contrast.java b/src/Effects/Contrast.java
new file mode 100644
index 0000000..759909c
--- /dev/null
+++ b/src/Effects/Contrast.java
@@ -0,0 +1,56 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package Effects;
+
+import Effects.Effects;
+
+/**
+ *
+ * @author Govind
+ */
+public class Contrast implements Effects {
+private int value;
+ public void Filter(int[] pixels, int width, int height, int sliderval) {
+ value = sliderval;
+ for (int i = 0; i < width * height; i++) {
+ pixels[i] = ProcessPixel(pixels[i]);
+ }
+
+ }
+
+ public int ProcessPixel(int pixel) {
+ int grey = 128;int approach=-100;
+ if(value>-100){approach = value;}
+ int red = (0xff & (pixel >> 16));
+ int green = (0xff & (pixel >> 8));
+ int blue = (0xff & pixel);
+ red = red + (red - grey) * approach / 100;
+ green = green + (green - grey) * approach / 100;
+ blue = blue + (blue - grey) * approach / 100;
+ // int lum = (int) ((0.299 * red) + (0.587 * green) + (0.114 * blue));
+ if (red > 255) {
+ red = 255;
+ }
+ if (red < 0) {
+ red = 0;
+ }
+ if (green > 255) {
+ green = 255;
+ }
+ if (green < 0) {
+ green = 0;
+ }
+ if (blue > 255) {
+ blue = 255;
+ }
+ if (blue < 0) {
+ blue = 0;
+ }
+ pixel = (0xff000000 | red << 16 | green << 8 | blue);
+ return pixel;
+ }
+
+
+}
diff --git a/src/Effects/ConvoEffect.java b/src/Effects/ConvoEffect.java
new file mode 100644
index 0000000..ed289e5
--- /dev/null
+++ b/src/Effects/ConvoEffect.java
@@ -0,0 +1,91 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package Effects;
+
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.awt.image.BufferedImageOp;
+import java.awt.image.ConvolveOp;
+import java.awt.image.ImageObserver;
+import java.awt.image.Kernel;
+
+/**
+ *
+ * @author Govind
+ */
+public class ConvoEffect {
+ BufferedImage bufim;
+ float[] kernel;
+ BufferedImageOp ConvOp;
+
+public ConvoEffect(String Operation)
+ {
+ if(Operation.equals("Sharpen"))
+ {
+ kernel = new float[] {
+ 0.0f, -1.0f, 0.0f,
+ -1.0f, 5.0f, -1.0f,
+ 0.0f, -1.0f, 0.0f
+ };
+ }
+else if(Operation.equals("Blur"))
+ {float num = 1.0f/9.0f;
+ kernel = new float[] {
+ num, num, num,
+ num, num, num,
+ num, num, num
+};
+ }
+else if(Operation.equals("Bump"))
+ {
+ kernel = new float[] {
+ 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 1.0f,
+ 0.0f, 0.0f,-1.0f
+};
+ }
+else if(Operation.equals("Edge"))
+ {
+ kernel = new float[] {
+ 0.0f, -1.0f, 0.0f,
+ -1.0f, 4.0f, -1.0f,
+ 0.0f, -1.0f, 0.0f
+};
+ }
+
+else if(Operation.equals("Emboss"))
+ {
+ kernel = new float[] {
+ -1.0f, -1.0f, 0.0f,
+ -1.0f, 0.0f, 1.0f,
+ 0.0f, 1.0f, 1.0f
+};
+ }
+else if(Operation.equals("Glow"))
+{float num = 1.0f/9.0f;
+ kernel = new float[] {
+ num, num, num,
+ num, 7*num, num,
+ num, num, num
+};
+}
+ ConvOp = new ConvolveOp(new Kernel(3, 3,kernel));
+ }
+
+public Image Filter(Image image,ImageObserver im)
+ { int width = image.getWidth(null);
+ int height = image.getHeight(null);
+
+ bufim = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
+ Graphics2D g2d = bufim.createGraphics();
+ g2d.drawImage(image,0,0,im);
+
+ image = ConvOp.filter(bufim, null);
+ return image;
+}
+
+}
diff --git a/src/Effects/DustFilter.java b/src/Effects/DustFilter.java
new file mode 100644
index 0000000..a1f2d60
--- /dev/null
+++ b/src/Effects/DustFilter.java
@@ -0,0 +1,85 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package Effects;
+
+/**
+ *
+ * @author Govind
+ */
+public class DustFilter implements Effects{
+
+private int rr,gg,bb,r,g,b;
+
+
+private int mod(int num)
+{
+ int pos;
+ if(num>=0) pos=num;
+ else pos=(-1)*num;
+ return pos;
+}
+
+ public void Filter(int[] pixels, int width, int height, int sliderval) {
+
+ int normal=128; int approach=50;int sum=0,flag=0;
+
+ for(int ii=width;ii0&&j>16));
+ gg+=(0xff & (p>>8));
+ bb+=(0xff & p);
+ }
+ else
+ {
+ r=(0xff & (p>>16));
+ g=(0xff & (p>>8));
+ b=(0xff & p);
+
+ }
+ }
+ }
+
+ if(mod(r*8-rr)>normal*4||mod(g*8-gg)>normal*4||mod(b*8-bb)>normal*4)
+ {
+ int red=rr/8;
+ int green=gg/8;
+ int blue=(bb/8);
+if(flag<10)
+{
+ System.out.println(blue);
+ flag++;
+}
+ if (red > 255) red =255;if(red<0) red=0;
+ if (green > 255) green=255;if(green<0) green=0;
+ if (blue >255) blue =255;if(blue<0) blue=0;
+ pixels[ii] =(0xff000000 | red << 16 | green << 8 | blue);
+ //if(flag<10) System.out.println(pixels[ii]);
+ }
+ }
+
+ }
+
+ }
+
+ public int ProcessPixel(int pixel) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+
+
+
+}
diff --git a/src/Effects/Effects.java b/src/Effects/Effects.java
new file mode 100644
index 0000000..370f7f4
--- /dev/null
+++ b/src/Effects/Effects.java
@@ -0,0 +1,19 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package Effects;
+
+import java.awt.Image;
+
+/**
+ *
+ * @author Govind
+ */
+public interface Effects {
+
+ void Filter(int pixels[],int width,int height,int sliderval);
+ int ProcessPixel(int pixel);
+
+}
diff --git a/src/Effects/Granulate.java b/src/Effects/Granulate.java
new file mode 100644
index 0000000..7f37b5b
--- /dev/null
+++ b/src/Effects/Granulate.java
@@ -0,0 +1,38 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package Effects;
+
+import Effects.Effects;
+
+/**
+ *
+ * @author Govind
+ */
+public class Granulate implements Effects{
+
+
+ public void Filter(int[] pixels, int width, int height, int sliderval) {
+float tmp;int marked; int mark[]=new int [width * height];
+for (int j = 0; j < 100; j++)
+for (int i = 0; i < 100; i++)
+{
+tmp = (float) (Math.random ( ) * (width * height));
+marked = (int) (tmp);
+while (mark [marked] == 1)
+{
+tmp = (float) (Math.random ( ) * (width * height));
+marked = (int) (tmp);
+}
+mark [marked] = 1;
+pixels [marked] = pixels [j * width + i];
+}
+ }
+
+ public int ProcessPixel(int pixel) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+}
diff --git a/src/Effects/GreenAdjust.java b/src/Effects/GreenAdjust.java
new file mode 100644
index 0000000..5c702e1
--- /dev/null
+++ b/src/Effects/GreenAdjust.java
@@ -0,0 +1,44 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package Effects;
+
+import Effects.Effects;
+
+/**
+ *
+ * @author Govind
+ */
+public class GreenAdjust implements Effects{
+ private int value;
+
+
+ public void Filter(int pixels[], int width, int height, int sliderval) {
+
+ value = sliderval;
+
+ for (int i = 0; i < width * height; i++) {
+ pixels[i] = ProcessPixel(pixels[i]);
+ }
+
+ }
+
+ public int ProcessPixel(int pixel) {
+ int red = (0xff & (pixel >> 16));
+ int green = (0xff & (pixel >> 8));
+ int blue = (0xff & pixel);
+
+ green = green + value;
+
+ if (green > 255) {
+ green = 255;
+ }
+ if (green < 0) {
+ green = 0;
+ }
+ pixel = (0xff000000 | red << 16 | green << 8 | blue);
+ return pixel;
+ }
+}
diff --git a/src/Effects/GreyScale.java b/src/Effects/GreyScale.java
new file mode 100644
index 0000000..3449e5a
--- /dev/null
+++ b/src/Effects/GreyScale.java
@@ -0,0 +1,34 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package Effects;
+
+/**
+ *
+ * @author Govind
+ */
+public class GreyScale implements Effects{
+ private int value;
+
+ public void Filter(int[] pixels, int width, int height, int sliderval) {
+ value = sliderval/50 + 1;
+ for(int k=1; k < value; k++){
+ for (int i = 0; i < width * height; i++) {
+ pixels[i] = ProcessPixel(pixels[i]);
+ }
+ }
+ }
+
+ public int ProcessPixel(int pixel) {
+ int red = (0xff & (pixel >> 16));
+ int green = (0xff & (pixel >> 8));
+ int blue = (0xff & (pixel));
+ int avg = (int)((red + green + blue)/3);
+ pixel = (0xff000000 | avg <<16 |green << 8 | avg);
+ return pixel;
+ }
+
+
+}
diff --git a/src/Effects/Hue.java b/src/Effects/Hue.java
new file mode 100644
index 0000000..999e013
--- /dev/null
+++ b/src/Effects/Hue.java
@@ -0,0 +1,65 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package Effects;
+
+import Effects.Effects;
+import java.awt.Color;
+
+/**
+ *
+ * @author Govind
+ */
+public class Hue implements Effects {
+
+ private int value;
+
+
+ public void Filter(int pixels[], int width, int height, int sliderval) {
+
+ value = sliderval;
+
+ for (int i = 0; i < width * height; i++) {
+ pixels[i] = ProcessPixel(pixels[i]);
+ }
+
+ }
+
+ public int ProcessPixel(int pixel) {
+ int red = (0xff & (pixel >> 16));
+ int green = (0xff & (pixel >> 8));
+ int blue = (0xff & pixel);
+
+ float hsb[] = Color.RGBtoHSB(red, green, blue, null);
+ hsb[0]=hsb[0]+(value/100.0f);
+ // hsb[1]=hsb[1]+value;
+ pixel = Color.HSBtoRGB(hsb[0],hsb[1],hsb[2]);
+ red = (0xff & (pixel >> 16));
+ green = (0xff & (pixel >> 8));
+ blue = (0xff & pixel);
+ if (red > 255) {
+ red = 255;
+ }
+ if (red < 0) {
+ red = 0;
+ }
+ if (green > 255) {
+ green = 255;
+ }
+ if (green < 0) {
+ green = 0;
+ }
+ if (blue > 255) {
+ blue = 255;
+ }
+ if (blue < 0) {
+ blue = 0;
+ }
+ pixel = (0xff000000 | red << 16 | green << 8 | blue);
+ return pixel;
+ }
+}
+
+
diff --git a/src/Effects/Invert.java b/src/Effects/Invert.java
new file mode 100644
index 0000000..b27e291
--- /dev/null
+++ b/src/Effects/Invert.java
@@ -0,0 +1,38 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package Effects;
+
+import Effects.Effects;
+
+/**
+ *
+ * @author Govind
+ */
+public class Invert implements Effects{
+
+ public void Filter(int[] pixels, int width, int height, int sliderval) {
+
+ for (int i = 0; i < width * height; i++) {
+ pixels[i] = ProcessPixel(pixels[i]);
+ }
+ }
+
+ public int ProcessPixel(int pixel) {
+ int red =(0xff & (pixel>>16));
+ int green = (0xff & (pixel>>8));
+ int blue = (0xff & pixel);
+ red = 256 - red;
+ green= 256 - green;
+ blue = 256 - blue;
+ if (red > 255) red =255;if(red<0) red=0;
+ if (green > 255) green=255;if(green<0) green=0;
+ if (blue >255) blue =255;if(blue<0) blue=0;
+ pixel = (0xff000000 | red << 16 | green <<8 | blue);
+ return pixel;
+ }
+
+
+}
diff --git a/src/Effects/Posterize.java b/src/Effects/Posterize.java
new file mode 100644
index 0000000..5d41deb
--- /dev/null
+++ b/src/Effects/Posterize.java
@@ -0,0 +1,36 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package Effects;
+
+import Effects.Effects;
+
+/**
+ *
+ * @author Govind
+ */
+public class Posterize implements Effects {
+
+ public void Filter(int[] pixels, int width, int height, int sliderval) {
+ for (int i = 0; i < width * height; i++) {
+ pixels[i] = ProcessPixel(pixels[i]);
+ }
+ }
+
+ public int ProcessPixel(int pixel) {
+ int red =(0xff & (pixel>>16));
+ int green = (0xff & (pixel>>8));
+ int blue = (0xff & pixel);
+ red = (red-(red%64));
+ green= (green-(green%64));
+ blue = (blue-(blue%64));
+ if (red > 255) red =255;if(red<0) red=0;
+ if (green > 255) green=255;if(green<0) green=0;
+ if (blue >255) blue =255;if(blue<0) blue=0;
+ pixel = (0xff000000 | red << 16 | green <<8 | blue);
+ return pixel;
+ }
+
+}
diff --git a/src/Effects/RedAdjust.java b/src/Effects/RedAdjust.java
new file mode 100644
index 0000000..abb2f1d
--- /dev/null
+++ b/src/Effects/RedAdjust.java
@@ -0,0 +1,44 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package Effects;
+
+import Effects.Effects;
+
+/**
+ *
+ * @author Govind
+ */
+public class RedAdjust implements Effects{
+ private int value;
+
+
+ public void Filter(int pixels[], int width, int height, int sliderval) {
+
+ value = sliderval;
+
+ for (int i = 0; i < width * height; i++) {
+ pixels[i] = ProcessPixel(pixels[i]);
+ }
+
+ }
+
+ public int ProcessPixel(int pixel) {
+ int red = (0xff & (pixel >> 16));
+ int green = (0xff & (pixel >> 8));
+ int blue = (0xff & pixel);
+
+ red = red + value;
+
+ if (red > 255) {
+ red = 255;
+ }
+ if (red < 0) {
+ red = 0;
+ }
+ pixel = (0xff000000 | red << 16 | green << 8 | blue);
+ return pixel;
+ }
+}
diff --git a/src/Effects/Saturation.java b/src/Effects/Saturation.java
new file mode 100644
index 0000000..34d57c9
--- /dev/null
+++ b/src/Effects/Saturation.java
@@ -0,0 +1,61 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package Effects;
+
+import java.awt.Color;
+
+/**
+ *
+ * @author Govind
+ */
+public class Saturation implements Effects {
+
+ private int value;
+
+
+ public void Filter(int pixels[], int width, int height, int sliderval) {
+
+ value = sliderval;
+
+ for (int i = 0; i < width * height; i++) {
+ pixels[i] = ProcessPixel(pixels[i]);
+ }
+
+ }
+
+ public int ProcessPixel(int pixel) {
+ int red = (0xff & (pixel >> 16));
+ int green = (0xff & (pixel >> 8));
+ int blue = (0xff & pixel);
+
+ float hsb[] = Color.RGBtoHSB(red, green, blue, null);
+ hsb[1]=hsb[1]+(value/100.0f);
+ pixel = Color.HSBtoRGB(hsb[0],hsb[1],hsb[2]);
+ red = (0xff & (pixel >> 16));
+ green = (0xff & (pixel >> 8));
+ blue = (0xff & pixel);
+ if (red > 255) {
+ red = 255;
+ }
+ if (red < 0) {
+ red = 0;
+ }
+ if (green > 255) {
+ green = 255;
+ }
+ if (green < 0) {
+ green = 0;
+ }
+ if (blue > 255) {
+ blue = 255;
+ }
+ if (blue < 0) {
+ blue = 0;
+ }
+ pixel = (0xff000000 | red << 16 | green << 8 | blue);
+ return pixel;
+ }
+}
diff --git a/src/Effects/Treshold.java b/src/Effects/Treshold.java
new file mode 100644
index 0000000..0e3989d
--- /dev/null
+++ b/src/Effects/Treshold.java
@@ -0,0 +1,44 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package Effects;
+
+/**
+ *
+ * @author Govind
+ */
+public class Treshold implements Effects{
+
+ public void Filter(int[] pixels, int width, int height, int sliderval) {
+ for (int i = 0; i < width * height; i++) {
+ pixels[i] = ProcessPixel(pixels[i]);
+ }
+ }
+
+ public int ProcessPixel(int pixel) {
+ int red =(0xff & (pixel>>16));
+ int green = (0xff & (pixel>>8));
+ int blue = (0xff & pixel);
+ int gr=(int)(0.3*red+0.59*green+0.11*blue);
+
+ int th = 128;
+ if(gr>=th)
+ {red=250;
+ blue=250;
+ green=250;}
+ else
+ {red = 10;
+ green= 10;
+ blue = 10;
+ }
+ if (red > 255) red =255;if(red<0) red=0;
+ if (green > 255) green=255;if(green<0) green=0;
+ if (blue >255) blue =255;if(blue<0) blue=0;
+ pixel = (0xff000000 | red << 16 | green <<8 | blue);
+ return pixel;
+ }
+
+
+}
diff --git a/src/imageapplication/ExampleFileFilter.java b/src/imageapplication/ExampleFileFilter.java
new file mode 100644
index 0000000..9c98420
--- /dev/null
+++ b/src/imageapplication/ExampleFileFilter.java
@@ -0,0 +1,222 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package imageapplication;
+
+
+import java.io.File;
+import java.util.Hashtable;
+import java.util.Enumeration;
+import javax.swing.*;
+import javax.swing.filechooser.*;
+
+public class ExampleFileFilter extends FileFilter {
+
+ private static String TYPE_UNKNOWN = "Type Unknown";
+ private static String HIDDEN_FILE = "Hidden File";
+
+ private Hashtable filters = null;
+ private String description = null;
+ private String fullDescription = null;
+ private boolean useExtensionsInDescription = true;
+
+ /**
+ * Creates a file filter. If no filters are added, then all
+ * files are accepted.
+ *
+ * @see #addExtension
+ */
+ public ExampleFileFilter() {
+ this.filters = new Hashtable();
+ }
+
+ /**
+ * Creates a file filter that accepts files with the given extension.
+ * Example: new ExampleFileFilter("jpg");
+ *
+ * @see #addExtension
+ */
+ public ExampleFileFilter(String extension) {
+ this(extension,null);
+ }
+
+ /**
+ * Creates a file filter that accepts the given file type.
+ * Example: new ExampleFileFilter("jpg", "JPEG Image Images");
+ *
+ * Note that the "." before the extension is not needed. If
+ * provided, it will be ignored.
+ *
+ * @see #addExtension
+ */
+ public ExampleFileFilter(String extension, String description) {
+ this();
+ if(extension!=null) addExtension(extension);
+ if(description!=null) setDescription(description);
+ }
+
+ /**
+ * Creates a file filter from the given string array.
+ * Example: new ExampleFileFilter(String {"gif", "jpg"});
+ *
+ * Note that the "." before the extension is not needed adn
+ * will be ignored.
+ *
+ * @see #addExtension
+ */
+ public ExampleFileFilter(String[] filters) {
+ this(filters, null);
+ }
+
+ /**
+ * Creates a file filter from the given string array and description.
+ * Example: new ExampleFileFilter(String {"gif", "jpg"}, "Gif and JPG Images");
+ *
+ * Note that the "." before the extension is not needed and will be ignored.
+ *
+ * @see #addExtension
+ */
+ public ExampleFileFilter(String[] filters, String description) {
+ this();
+ for (int i = 0; i < filters.length; i++) {
+ // add filters one by one
+ addExtension(filters[i]);
+ }
+ if(description!=null) setDescription(description);
+ }
+
+ /**
+ * Return true if this file should be shown in the directory pane,
+ * false if it shouldn't.
+ *
+ * Files that begin with "." are ignored.
+ *
+ * @see #getExtension
+ * @see FileFilter#accepts
+ */
+ public boolean accept(File f) {
+ if(f != null) {
+ if(f.isDirectory()) {
+ return true;
+ }
+ String extension = getExtension(f);
+ if(extension != null && filters.get(getExtension(f)) != null) {
+ return true;
+ };
+ }
+ return false;
+ }
+
+ /**
+ * Return the extension portion of the file's name .
+ *
+ * @see #getExtension
+ * @see FileFilter#accept
+ */
+ public String getExtension(File f) {
+ if(f != null) {
+ String filename = f.getName();
+ int i = filename.lastIndexOf('.');
+ if(i>0 && i
+
+
diff --git a/src/imageapplication/MainFrame.java b/src/imageapplication/MainFrame.java
new file mode 100644
index 0000000..151ba79
--- /dev/null
+++ b/src/imageapplication/MainFrame.java
@@ -0,0 +1,1184 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package imageapplication;
+
+import Effects.Posterize;
+import Effects.Treshold;
+import Effects.Saturation;
+import Effects.RedAdjust;
+import Effects.Hue;
+import Effects.GreyScale;
+import Effects.GreenAdjust;
+import Effects.Granulate;
+import Effects.Contrast;
+import Effects.BlueAdjust;
+import Effects.AutoColor;
+import Effects.AutoBrighten;
+import Effects.AutoContrast;
+import Effects.Invert;
+import Effects.Effects;
+import Effects.Brighten;
+import Effects.ConvoEffect;
+import Effects.DustFilter;
+import java.awt.AlphaComposite;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.MediaTracker;
+import java.awt.Point;
+import java.awt.RenderingHints;
+import java.awt.color.ColorSpace;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.geom.AffineTransform;
+import java.awt.image.AffineTransformOp;
+import java.awt.image.BufferedImage;
+import java.awt.image.BufferedImageOp;
+import java.awt.image.ColorConvertOp;
+import java.awt.image.ConvolveOp;
+import java.awt.image.CropImageFilter;
+import java.awt.image.FilteredImageSource;
+import java.awt.image.ImageFilter;
+import java.awt.image.Kernel;
+import java.awt.image.MemoryImageSource;
+import java.awt.image.PixelGrabber;
+import java.awt.image.RenderedImage;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.lang.String;
+import javax.imageio.ImageIO;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JSlider;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+/**
+ *
+ * @author Govind
+ */
+public class MainFrame extends javax.swing.JFrame implements ChangeListener, MouseListener {
+
+ ImageViewer imageviewer1;
+ int pixels[];
+ Effects CurrEffect;
+ ConvoEffect ConvEffect;
+ private BufferedImage bufim;
+ int mx1,my1,mx2,my2,ismouseclicked=0,crop=1;
+
+ /** Creates new form MainFrame */
+ public MainFrame() {
+ initComponents();
+ AdjModule1.setLocation(200,200);
+ AdjModule1.setSize(320, 150);
+ AdjModule1.setTitle("Adjust");
+ AdjModule1.setClosable(true);
+
+ jSlider1.setMaximum(256);
+ jSlider1.setMinimum(-150);
+ jSlider1.setMajorTickSpacing(50);
+ jSlider1.setMinorTickSpacing(10);
+ jSlider1.setValue(50);
+ jSlider1.setPaintTicks(true);
+ jSlider1.addChangeListener(this);
+ this.add(AdjModule1);
+
+ }
+
+ private void InitPixels(Image image) {
+ int width = image.getWidth(null);
+ int height = image.getHeight(null);
+ pixels = new int[width * height];
+
+ PixelGrabber pg = new PixelGrabber(image, 0, 0, width, height, pixels, 0, width);
+
+ try {
+ pg.grabPixels();
+ } catch (InterruptedException ex) {
+ ex.printStackTrace();
+ }
+
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ ConfirmDialog = new javax.swing.JDialog();
+ jLabel1 = new javax.swing.JLabel();
+ jButton6 = new javax.swing.JButton();
+ jButton5 = new javax.swing.JButton();
+ ResizeDialog = new javax.swing.JDialog();
+ jSpinner1 = new javax.swing.JSpinner();
+ jSpinner2 = new javax.swing.JSpinner();
+ jLabel2 = new javax.swing.JLabel();
+ jLabel3 = new javax.swing.JLabel();
+ jLabel4 = new javax.swing.JLabel();
+ jButton16 = new javax.swing.JButton();
+ jButton17 = new javax.swing.JButton();
+ AdjModule1 = new javax.swing.JInternalFrame();
+ jSlider1 = new javax.swing.JSlider();
+ jButton27 = new javax.swing.JButton();
+ jButton28 = new javax.swing.JButton();
+ AutomaticControlsPanel = new javax.swing.JPanel();
+ AutoBrightenButton = new javax.swing.JButton();
+ AutoColorButton = new javax.swing.JButton();
+ AutoContrastButton = new javax.swing.JButton();
+ DustFilterButton = new javax.swing.JButton();
+ GlowButton = new javax.swing.JButton();
+ AutoEnhanceButton = new javax.swing.JButton();
+ ManualControlsPanel = new javax.swing.JPanel();
+ BrightenButton = new javax.swing.JButton();
+ ContrastButton = new javax.swing.JButton();
+ GreyScaleButton = new javax.swing.JButton();
+ InvertButton = new javax.swing.JButton();
+ PosterizeButton = new javax.swing.JButton();
+ TresholdButton = new javax.swing.JButton();
+ SharpenButton = new javax.swing.JButton();
+ BlurButton = new javax.swing.JButton();
+ BumpButton = new javax.swing.JButton();
+ EdgeDetectButton = new javax.swing.JButton();
+ ResizeButton = new javax.swing.JButton();
+ EmbossButton = new javax.swing.JButton();
+ RedAdjButton = new javax.swing.JButton();
+ BlueAdjButton = new javax.swing.JButton();
+ GreenAdjButton = new javax.swing.JButton();
+ HueButton = new javax.swing.JButton();
+ SaturationButton = new javax.swing.JButton();
+ GranulateButton = new javax.swing.JButton();
+ CropButton = new javax.swing.JButton();
+ jMenuBar1 = new javax.swing.JMenuBar();
+ FileMenu = new javax.swing.JMenu();
+ OpenMenuItem = new javax.swing.JMenuItem();
+ SaveMenuItem = new javax.swing.JMenuItem();
+ QuitMenuItem = new javax.swing.JMenuItem();
+ EditMenu = new javax.swing.JMenu();
+ jMenuItem1 = new javax.swing.JMenuItem();
+ jMenuItem2 = new javax.swing.JMenuItem();
+
+ jLabel1.setText("Do You wish to Apply This Effect ?");
+
+ jButton6.setText("Cancel");
+ jButton6.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButton6ActionPerformed(evt);
+ }
+ });
+
+ jButton5.setText("Apply");
+ jButton5.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButton5ActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout ConfirmDialogLayout = new javax.swing.GroupLayout(ConfirmDialog.getContentPane());
+ ConfirmDialog.getContentPane().setLayout(ConfirmDialogLayout);
+ ConfirmDialogLayout.setHorizontalGroup(
+ ConfirmDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(ConfirmDialogLayout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(ConfirmDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+ .addGroup(ConfirmDialogLayout.createSequentialGroup()
+ .addComponent(jLabel1)
+ .addContainerGap())
+ .addGroup(ConfirmDialogLayout.createSequentialGroup()
+ .addComponent(jButton5)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jButton6)
+ .addGap(18, 18, 18))))
+ );
+ ConfirmDialogLayout.setVerticalGroup(
+ ConfirmDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ConfirmDialogLayout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE)
+ .addGap(18, 18, 18)
+ .addGroup(ConfirmDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jButton5)
+ .addComponent(jButton6))
+ .addContainerGap())
+ );
+
+ jLabel2.setText("Width: ");
+
+ jLabel3.setText("Height:");
+
+ jLabel4.setText("Enter the new dimensions for the image:");
+
+ jButton16.setText("Apply");
+ jButton16.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButton16ActionPerformed(evt);
+ }
+ });
+
+ jButton17.setText("Cancel");
+ jButton17.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButton17ActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout ResizeDialogLayout = new javax.swing.GroupLayout(ResizeDialog.getContentPane());
+ ResizeDialog.getContentPane().setLayout(ResizeDialogLayout);
+ ResizeDialogLayout.setHorizontalGroup(
+ ResizeDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(ResizeDialogLayout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(ResizeDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jLabel4)
+ .addGroup(ResizeDialogLayout.createSequentialGroup()
+ .addGap(40, 40, 40)
+ .addGroup(ResizeDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(ResizeDialogLayout.createSequentialGroup()
+ .addComponent(jLabel3)
+ .addGap(18, 18, 18)
+ .addComponent(jSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGroup(ResizeDialogLayout.createSequentialGroup()
+ .addComponent(jLabel2)
+ .addGap(18, 18, 18)
+ .addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
+ .addGap(48, 48, 48)))
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ResizeDialogLayout.createSequentialGroup()
+ .addGap(24, 24, 24)
+ .addComponent(jButton16)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE)
+ .addComponent(jButton17)
+ .addGap(32, 32, 32))
+ );
+ ResizeDialogLayout.setVerticalGroup(
+ ResizeDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(ResizeDialogLayout.createSequentialGroup()
+ .addGap(43, 43, 43)
+ .addComponent(jLabel4)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addGroup(ResizeDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel2))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addGroup(ResizeDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jLabel3)
+ .addComponent(jSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE)
+ .addGroup(ResizeDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jButton17)
+ .addComponent(jButton16, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGap(19, 19, 19))
+ );
+
+ jButton27.setText("Apply");
+ jButton27.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButton27ActionPerformed(evt);
+ }
+ });
+
+ jButton28.setText("Cancel");
+ jButton28.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButton28ActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout AdjModule1Layout = new javax.swing.GroupLayout(AdjModule1.getContentPane());
+ AdjModule1.getContentPane().setLayout(AdjModule1Layout);
+ AdjModule1Layout.setHorizontalGroup(
+ AdjModule1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(AdjModule1Layout.createSequentialGroup()
+ .addGap(22, 22, 22)
+ .addGroup(AdjModule1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+ .addGroup(AdjModule1Layout.createSequentialGroup()
+ .addComponent(jButton27)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jButton28))
+ .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addContainerGap(26, Short.MAX_VALUE))
+ );
+ AdjModule1Layout.setVerticalGroup(
+ AdjModule1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(AdjModule1Layout.createSequentialGroup()
+ .addGap(30, 30, 30)
+ .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(18, 18, 18)
+ .addGroup(AdjModule1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jButton27)
+ .addComponent(jButton28))
+ .addContainerGap(34, Short.MAX_VALUE))
+ );
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+ setTitle("AUTIMEN - Auto Image Enhance !!!");
+ setResizable(false);
+
+ AutomaticControlsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Automatic Controls"));
+
+ AutoBrightenButton.setText("AutoBrighten");
+ AutoBrightenButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ AutoBrightenButtonActionPerformed(evt);
+ }
+ });
+
+ AutoColorButton.setText("Auto Color");
+ AutoColorButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ AutoColorButtonActionPerformed(evt);
+ }
+ });
+
+ AutoContrastButton.setText("Auto Contrast");
+ AutoContrastButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ AutoContrastButtonActionPerformed(evt);
+ }
+ });
+
+ DustFilterButton.setText("Dust Filter");
+ DustFilterButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ DustFilterButtonActionPerformed(evt);
+ }
+ });
+
+ GlowButton.setText("Glow");
+ GlowButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ GlowButtonActionPerformed(evt);
+ }
+ });
+
+ AutoEnhanceButton.setText("AutoEnhancement");
+ AutoEnhanceButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ AutoEnhanceButtonActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout AutomaticControlsPanelLayout = new javax.swing.GroupLayout(AutomaticControlsPanel);
+ AutomaticControlsPanel.setLayout(AutomaticControlsPanelLayout);
+ AutomaticControlsPanelLayout.setHorizontalGroup(
+ AutomaticControlsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(AutomaticControlsPanelLayout.createSequentialGroup()
+ .addGap(169, 169, 169)
+ .addComponent(AutoBrightenButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(AutoColorButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(AutoContrastButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(GlowButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(DustFilterButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(AutoEnhanceButton)
+ .addContainerGap(669, Short.MAX_VALUE))
+ );
+ AutomaticControlsPanelLayout.setVerticalGroup(
+ AutomaticControlsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, AutomaticControlsPanelLayout.createSequentialGroup()
+ .addContainerGap(41, Short.MAX_VALUE)
+ .addGroup(AutomaticControlsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(AutoBrightenButton)
+ .addComponent(AutoColorButton)
+ .addComponent(AutoContrastButton)
+ .addComponent(GlowButton)
+ .addComponent(DustFilterButton)
+ .addComponent(AutoEnhanceButton))
+ .addGap(36, 36, 36))
+ );
+
+ ManualControlsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Manual Controls"));
+
+ BrightenButton.setText("Brighten");
+ BrightenButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ BrightenButtonActionPerformed(evt);
+ }
+ });
+
+ ContrastButton.setText("Contrast");
+ ContrastButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ ContrastButtonActionPerformed(evt);
+ }
+ });
+
+ GreyScaleButton.setText("GreyScale");
+ GreyScaleButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ GreyScaleButtonActionPerformed(evt);
+ }
+ });
+
+ InvertButton.setText("Invert");
+ InvertButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ InvertButtonActionPerformed(evt);
+ }
+ });
+
+ PosterizeButton.setText("Posterize");
+ PosterizeButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ PosterizeButtonActionPerformed(evt);
+ }
+ });
+
+ TresholdButton.setText("Treshold");
+ TresholdButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ TresholdButtonActionPerformed(evt);
+ }
+ });
+
+ SharpenButton.setText("Sharpen");
+ SharpenButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ SharpenButtonActionPerformed(evt);
+ }
+ });
+
+ BlurButton.setText("Blur");
+ BlurButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ BlurButtonActionPerformed(evt);
+ }
+ });
+
+ BumpButton.setText("Bump");
+ BumpButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ BumpButtonActionPerformed(evt);
+ }
+ });
+
+ EdgeDetectButton.setText("Edge Detection");
+ EdgeDetectButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ EdgeDetectButtonActionPerformed(evt);
+ }
+ });
+
+ ResizeButton.setText("Resize");
+ ResizeButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ ResizeButtonActionPerformed(evt);
+ }
+ });
+
+ EmbossButton.setText("Emboss");
+ EmbossButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ EmbossButtonActionPerformed(evt);
+ }
+ });
+
+ RedAdjButton.setText("Red Adjust");
+ RedAdjButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ RedAdjButtonActionPerformed(evt);
+ }
+ });
+
+ BlueAdjButton.setText("Blue Adjust");
+ BlueAdjButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ BlueAdjButtonActionPerformed(evt);
+ }
+ });
+
+ GreenAdjButton.setText("Green Adjust");
+ GreenAdjButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ GreenAdjButtonActionPerformed(evt);
+ }
+ });
+
+ HueButton.setText("Hue Adjust ");
+ HueButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ HueButtonActionPerformed(evt);
+ }
+ });
+
+ SaturationButton.setText("Saturation Adjust");
+ SaturationButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ SaturationButtonActionPerformed(evt);
+ }
+ });
+
+ GranulateButton.setText("Granulate");
+ GranulateButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ GranulateButtonActionPerformed(evt);
+ }
+ });
+
+ CropButton.setText("Crop");
+ CropButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ CropButtonActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout ManualControlsPanelLayout = new javax.swing.GroupLayout(ManualControlsPanel);
+ ManualControlsPanel.setLayout(ManualControlsPanelLayout);
+ ManualControlsPanelLayout.setHorizontalGroup(
+ ManualControlsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(ManualControlsPanelLayout.createSequentialGroup()
+ .addGap(159, 159, 159)
+ .addGroup(ManualControlsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(ManualControlsPanelLayout.createSequentialGroup()
+ .addComponent(BrightenButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(ContrastButton))
+ .addGroup(ManualControlsPanelLayout.createSequentialGroup()
+ .addComponent(ResizeButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(RedAdjButton)))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(ManualControlsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(ManualControlsPanelLayout.createSequentialGroup()
+ .addComponent(BlueAdjButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(GreenAdjButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(HueButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(SaturationButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(GranulateButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(CropButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(EmbossButton))
+ .addGroup(ManualControlsPanelLayout.createSequentialGroup()
+ .addComponent(GreyScaleButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(InvertButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(PosterizeButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(TresholdButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(SharpenButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(BlurButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(BumpButton)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(EdgeDetectButton)))
+ .addContainerGap(447, Short.MAX_VALUE))
+ );
+ ManualControlsPanelLayout.setVerticalGroup(
+ ManualControlsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(ManualControlsPanelLayout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(ManualControlsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(ManualControlsPanelLayout.createSequentialGroup()
+ .addGroup(ManualControlsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(BrightenButton)
+ .addComponent(ContrastButton))
+ .addGap(18, 18, 18)
+ .addGroup(ManualControlsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(ResizeButton)
+ .addComponent(RedAdjButton)))
+ .addGroup(ManualControlsPanelLayout.createSequentialGroup()
+ .addGroup(ManualControlsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(GreyScaleButton)
+ .addComponent(InvertButton)
+ .addComponent(PosterizeButton)
+ .addComponent(TresholdButton)
+ .addComponent(SharpenButton)
+ .addComponent(BlurButton)
+ .addComponent(BumpButton)
+ .addComponent(EdgeDetectButton))
+ .addGap(18, 18, 18)
+ .addGroup(ManualControlsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(BlueAdjButton)
+ .addComponent(GreenAdjButton)
+ .addComponent(HueButton)
+ .addComponent(SaturationButton)
+ .addComponent(GranulateButton)
+ .addComponent(CropButton)
+ .addComponent(EmbossButton))))
+ .addContainerGap(25, Short.MAX_VALUE))
+ );
+
+ FileMenu.setText("File");
+
+ OpenMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));
+ OpenMenuItem.setText("Open");
+ OpenMenuItem.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ OpenMenuItemActionPerformed(evt);
+ }
+ });
+ FileMenu.add(OpenMenuItem);
+
+ SaveMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
+ SaveMenuItem.setText("Save");
+ SaveMenuItem.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ SaveMenuItemActionPerformed(evt);
+ }
+ });
+ FileMenu.add(SaveMenuItem);
+
+ QuitMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_MASK));
+ QuitMenuItem.setText("Quit");
+ QuitMenuItem.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ QuitMenuItemActionPerformed(evt);
+ }
+ });
+ FileMenu.add(QuitMenuItem);
+
+ jMenuBar1.add(FileMenu);
+
+ EditMenu.setText("Help");
+
+ jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H, java.awt.event.InputEvent.CTRL_MASK));
+ jMenuItem1.setText("Contents");
+ jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jMenuItem1ActionPerformed(evt);
+ }
+ });
+ EditMenu.add(jMenuItem1);
+
+ jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));
+ jMenuItem2.setText("About Us");
+ jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jMenuItem2ActionPerformed(evt);
+ }
+ });
+ EditMenu.add(jMenuItem2);
+
+ jMenuBar1.add(EditMenu);
+
+ setJMenuBar(jMenuBar1);
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(AutomaticControlsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(ManualControlsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGap(10, 10, 10))
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(AutomaticControlsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 506, Short.MAX_VALUE)
+ .addComponent(ManualControlsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void OpenMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OpenMenuItemActionPerformed
+ imageviewer1 = new ImageViewer();
+ imageviewer1.addMouseListener(this);
+ this.add(imageviewer1);
+ this.pack();
+ imageviewer1.setVisible(true);
+ InitPixels(imageviewer1.image);
+ // TODO add your handling code here:
+}//GEN-LAST:event_OpenMenuItemActionPerformed
+
+ private void BrightenButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BrightenButtonActionPerformed
+ AdjModule1.setVisible(true);
+ CurrEffect = new Brighten();
+ // TODO add your handling code here:
+}//GEN-LAST:event_BrightenButtonActionPerformed
+
+ private void ContrastButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ContrastButtonActionPerformed
+ AdjModule1.setVisible(true);
+ CurrEffect = new Contrast();
+ // TODO add your handling code here:
+}//GEN-LAST:event_ContrastButtonActionPerformed
+
+ private void GreyScaleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GreyScaleButtonActionPerformed
+ AdjModule1.setVisible(true);
+ CurrEffect = new GreyScale();
+ // TODO add your handling code here:
+}//GEN-LAST:event_GreyScaleButtonActionPerformed
+
+ private void InvertButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_InvertButtonActionPerformed
+ CurrEffect = new Invert();
+ int width = imageviewer1.image.getWidth(null);
+ int height = imageviewer1.image.getHeight(null);
+ InitPixels(imageviewer1.image);
+ CurrEffect.Filter(pixels, width, height,0);
+
+ imageviewer1.image2 = createImage(new MemoryImageSource(width, height, pixels, 0, width));
+ ConfirmDialog.setVisible(true);
+ ConfirmDialog.setBounds(200,200,250,150);
+ imageviewer1.preview();
+ // TODO add your handling code here:
+}//GEN-LAST:event_InvertButtonActionPerformed
+
+ private void PosterizeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_PosterizeButtonActionPerformed
+ CurrEffect = new Posterize();
+ int width = imageviewer1.image.getWidth(null);
+ int height = imageviewer1.image.getHeight(null);
+ InitPixels(imageviewer1.image);
+ CurrEffect.Filter(pixels, width, height,0);
+
+ imageviewer1.image2 = createImage(new MemoryImageSource(width, height, pixels, 0, width));
+ ConfirmDialog.setVisible(true);
+ ConfirmDialog.setBounds(200,200,250,150);
+ imageviewer1.preview();// TODO add your handling code here:
+}//GEN-LAST:event_PosterizeButtonActionPerformed
+
+ private void TresholdButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TresholdButtonActionPerformed
+ CurrEffect = new Treshold();
+ int width = imageviewer1.image.getWidth(null);
+ int height = imageviewer1.image.getHeight(null);
+ InitPixels(imageviewer1.image);
+ CurrEffect.Filter(pixels, width, height,0);
+
+ imageviewer1.image2 = createImage(new MemoryImageSource(width, height, pixels, 0, width));
+ ConfirmDialog.setVisible(true);
+ ConfirmDialog.setBounds(200,200,220,150);
+ imageviewer1.preview();
+ // TODO add your handling code here:
+}//GEN-LAST:event_TresholdButtonActionPerformed
+
+ private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
+ imageviewer1.setSize(imageviewer1.image.getWidth(null), imageviewer1.image.getHeight(null));
+ imageviewer1.repaint();
+ ConfirmDialog.setVisible(false);
+ // TODO add your handling code here:
+ }//GEN-LAST:event_jButton6ActionPerformed
+
+ private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
+ imageviewer1.switchimg();
+ imageviewer1.repaint();
+ ConfirmDialog.setVisible(false);
+ // TODO add your handling code here:
+ }//GEN-LAST:event_jButton5ActionPerformed
+
+ private void AutoBrightenButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AutoBrightenButtonActionPerformed
+ CurrEffect = new AutoBrighten();
+ int width = imageviewer1.image.getWidth(null);
+ int height = imageviewer1.image.getHeight(null);
+ InitPixels(imageviewer1.image);
+ CurrEffect.Filter(pixels, width, height,0);
+
+ imageviewer1.image2 = createImage(new MemoryImageSource(width, height, pixels, 0, width));
+ ConfirmDialog.setVisible(true);
+ ConfirmDialog.setBounds(200,200,220,150);
+ imageviewer1.preview();
+ // TODO add your handling code here:
+}//GEN-LAST:event_AutoBrightenButtonActionPerformed
+
+ private void SharpenButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SharpenButtonActionPerformed
+
+ ConvEffect = new ConvoEffect("Sharpen");
+ imageviewer1.image2=ConvEffect.Filter(imageviewer1.image,this);
+
+ ConfirmDialog.setVisible(true);
+ ConfirmDialog.setBounds(200,200,220,150);
+ imageviewer1.preview();
+ // TODO add your handling code here:
+}//GEN-LAST:event_SharpenButtonActionPerformed
+
+ private void BlurButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BlurButtonActionPerformed
+ ConvEffect = new ConvoEffect("Blur");
+ imageviewer1.image2=ConvEffect.Filter(imageviewer1.image,this);
+
+ ConfirmDialog.setVisible(true);
+ ConfirmDialog.setBounds(200,200,220,150);
+ imageviewer1.preview();
+ // TODO add your handling code here:
+}//GEN-LAST:event_BlurButtonActionPerformed
+
+ private void BumpButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BumpButtonActionPerformed
+ ConvEffect = new ConvoEffect("Bump");
+ imageviewer1.image2=ConvEffect.Filter(imageviewer1.image,this);
+
+ ConfirmDialog.setVisible(true);
+ ConfirmDialog.setBounds(200,200,220,150);
+ imageviewer1.preview();
+ // TODO add your handling code here:
+}//GEN-LAST:event_BumpButtonActionPerformed
+
+ private void EdgeDetectButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EdgeDetectButtonActionPerformed
+ ConvEffect = new ConvoEffect("Edge");
+ imageviewer1.image2=ConvEffect.Filter(imageviewer1.image,this);
+
+ ConfirmDialog.setVisible(true);
+ ConfirmDialog.setBounds(200,200,220,150);
+ imageviewer1.preview();
+ // TODO add your handling code here:
+}//GEN-LAST:event_EdgeDetectButtonActionPerformed
+
+ private void ResizeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ResizeButtonActionPerformed
+
+ jSpinner1.setValue(imageviewer1.image.getWidth(null));
+ jSpinner2.setValue(imageviewer1.image.getHeight(null));
+ ResizeDialog.setVisible(true);
+ ResizeDialog.setBounds(200,200,250,200);
+
+ // TODO add your handling code here:
+}//GEN-LAST:event_ResizeButtonActionPerformed
+
+ private void EmbossButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EmbossButtonActionPerformed
+ ConvEffect = new ConvoEffect("Emboss");
+ imageviewer1.image2=ConvEffect.Filter(imageviewer1.image,this);
+
+ ConfirmDialog.setVisible(true);
+ ConfirmDialog.setBounds(200,200,220,150);
+ imageviewer1.preview(); // TODO add your handling code here:
+}//GEN-LAST:event_EmbossButtonActionPerformed
+
+ private void jButton16ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton16ActionPerformed
+ float width = imageviewer1.image.getWidth(null);
+ float height = imageviewer1.image.getHeight(null);
+
+ bufim = new BufferedImage((int)width,(int)height,BufferedImage.TYPE_INT_RGB);
+ Integer w= (Integer) jSpinner1.getValue();
+ Integer h= (Integer) jSpinner2.getValue();
+ ResizeDialog.setVisible(false);
+
+ float widthratio = (((float)w.doubleValue())/((float)width));float heightratio = ((float)h.intValue())/((float)(height));
+
+ Graphics2D g2d = bufim.createGraphics();
+ g2d.drawImage(imageviewer1.image,0,0,this);
+
+AffineTransform transform = AffineTransform.getScaleInstance(widthratio, heightratio);
+AffineTransformOp op = new AffineTransformOp(transform,AffineTransformOp.TYPE_BILINEAR);
+
+imageviewer1.image = op.filter(bufim, null);
+
+ imageviewer1.setSize(imageviewer1.image.getWidth(null), imageviewer1.image.getHeight(null));
+ imageviewer1.repaint();
+
+ // TODO add your handling code here:
+ }//GEN-LAST:event_jButton16ActionPerformed
+
+ private void jButton17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton17ActionPerformed
+ResizeDialog.setVisible(false);
+ // TODO add your handling code here:
+ }//GEN-LAST:event_jButton17ActionPerformed
+
+ private void RedAdjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RedAdjButtonActionPerformed
+ AdjModule1.setVisible(true);
+ CurrEffect = new RedAdjust();
+ // TODO add your handling code here:
+}//GEN-LAST:event_RedAdjButtonActionPerformed
+
+ private void BlueAdjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BlueAdjButtonActionPerformed
+ AdjModule1.setVisible(true);
+ CurrEffect = new BlueAdjust(); // TODO add your handling code here:
+}//GEN-LAST:event_BlueAdjButtonActionPerformed
+
+ private void GreenAdjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GreenAdjButtonActionPerformed
+ AdjModule1.setVisible(true);
+ CurrEffect = new GreenAdjust(); // TODO add your handling code here:
+}//GEN-LAST:event_GreenAdjButtonActionPerformed
+
+ private void HueButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_HueButtonActionPerformed
+ AdjModule1.setVisible(true);
+ CurrEffect = new Hue();
+ // TODO add your handling code here:
+}//GEN-LAST:event_HueButtonActionPerformed
+
+ private void SaturationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SaturationButtonActionPerformed
+ AdjModule1.setVisible(true);
+ CurrEffect = new Saturation();
+ // TODO add your handling code here:
+}//GEN-LAST:event_SaturationButtonActionPerformed
+
+ private void GranulateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GranulateButtonActionPerformed
+ CurrEffect = new Granulate();
+ int width = imageviewer1.image.getWidth(null);
+ int height = imageviewer1.image.getHeight(null);
+ InitPixels(imageviewer1.image);
+ CurrEffect.Filter(pixels, width, height,0);
+
+ imageviewer1.image2 = createImage(new MemoryImageSource(width, height, pixels, 0, width));
+ ConfirmDialog.setVisible(true);
+ ConfirmDialog.setBounds(200,200,220,150);
+ imageviewer1.preview(); // TODO add your handling code here:
+}//GEN-LAST:event_GranulateButtonActionPerformed
+
+ private void AutoColorButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AutoColorButtonActionPerformed
+ CurrEffect = new AutoColor();
+ int width = imageviewer1.image.getWidth(null);
+ int height = imageviewer1.image.getHeight(null);
+ InitPixels(imageviewer1.image);
+ CurrEffect.Filter(pixels, width, height,0);
+
+ imageviewer1.image2 = createImage(new MemoryImageSource(width, height, pixels, 0, width));
+ ConfirmDialog.setVisible(true);
+ ConfirmDialog.setBounds(200,200,220,150);
+ imageviewer1.preview();
+ // TODO add your handling code here:
+}//GEN-LAST:event_AutoColorButtonActionPerformed
+
+ private void jButton27ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton27ActionPerformed
+ imageviewer1.switchimg();
+ imageviewer1.repaint();
+ AdjModule1.setVisible(false);
+ jSlider1.setValue(50);
+ // TODO add your handling code here:
+}//GEN-LAST:event_jButton27ActionPerformed
+
+ private void jButton28ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton28ActionPerformed
+ imageviewer1.repaint();
+ AdjModule1.setVisible(false);
+ jSlider1.setValue(50);
+ // TODO add your handling code here:
+ }//GEN-LAST:event_jButton28ActionPerformed
+
+ @SuppressWarnings("empty-statement")
+ private void CropButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CropButtonActionPerformed
+ crop=1;
+ // TODO add your handling code here:
+}//GEN-LAST:event_CropButtonActionPerformed
+
+ private void AutoContrastButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AutoContrastButtonActionPerformed
+ CurrEffect = new AutoContrast();
+ int width = imageviewer1.image.getWidth(null);
+ int height = imageviewer1.image.getHeight(null);
+ InitPixels(imageviewer1.image);
+ CurrEffect.Filter(pixels, width, height,0);
+
+ imageviewer1.image2 = createImage(new MemoryImageSource(width, height, pixels, 0, width));
+ ConfirmDialog.setVisible(true);
+ ConfirmDialog.setBounds(200,200,220,150);
+ imageviewer1.preview(); // TODO add your handling code here:
+}//GEN-LAST:event_AutoContrastButtonActionPerformed
+
+ private void DustFilterButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DustFilterButtonActionPerformed
+ CurrEffect = new DustFilter();
+ int width = imageviewer1.image.getWidth(null);
+ int height = imageviewer1.image.getHeight(null);
+ InitPixels(imageviewer1.image);
+ CurrEffect.Filter(pixels, width, height,0);
+
+ imageviewer1.image2 = createImage(new MemoryImageSource(width, height, pixels, 0, width));
+ ConfirmDialog.setVisible(true);
+ ConfirmDialog.setBounds(200,200,220,150);
+ imageviewer1.preview(); // TODO add your handling code here:
+}//GEN-LAST:event_DustFilterButtonActionPerformed
+
+ private void GlowButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GlowButtonActionPerformed
+ ConvEffect = new ConvoEffect("Glow");
+ imageviewer1.image2=ConvEffect.Filter(imageviewer1.image,this);
+ ConfirmDialog.setVisible(true);
+ ConfirmDialog.setBounds(200,200,220,150);
+ imageviewer1.preview();
+ // TODO add your handling code here:
+}//GEN-LAST:event_GlowButtonActionPerformed
+
+ private void QuitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_QuitMenuItemActionPerformed
+this.dispose();// TODO add your handling code here:
+}//GEN-LAST:event_QuitMenuItemActionPerformed
+
+ private void SaveMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SaveMenuItemActionPerformed
+
+ int w = imageviewer1.image.getWidth(null);
+ int h = imageviewer1.image.getHeight(null);
+ int type = BufferedImage.TYPE_INT_RGB; // other options
+ bufim = new BufferedImage(w, h, type);
+ Graphics2D g2 = bufim.createGraphics();
+ g2.drawImage(imageviewer1.image, 0, 0, null);
+ g2.dispose();
+ JFrame f = new JFrame();
+ JFileChooser chooser = new JFileChooser();
+
+ chooser.setDialogType( JFileChooser.SAVE_DIALOG ) ;
+ chooser.setAcceptAllFileFilterUsed(false);
+
+ chooser.showSaveDialog(f);
+ File output = new File(chooser.getSelectedFile().toString());
+
+try {
+ ImageIO.write(bufim,"jpg", output); // ignore returned boolean
+ } catch(IOException e) {
+ System.out.println("Write error for " + output.getPath() +
+ ": " + e.getMessage());
+ }
+// TODO add your handling code here:
+ }//GEN-LAST:event_SaveMenuItemActionPerformed
+
+ private void AutoEnhanceButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AutoEnhanceButtonActionPerformed
+ int width = imageviewer1.image.getWidth(null);
+ int height = imageviewer1.image.getHeight(null);
+ CurrEffect = new DustFilter();
+ InitPixels(imageviewer1.image);
+ CurrEffect.Filter(pixels, width, height,0);
+
+
+for(int i=0;i<1;i++)
+{
+ ConvEffect = new ConvoEffect("Sharpen");
+ imageviewer1.image2=ConvEffect.Filter(imageviewer1.image,this);
+ ConvEffect = new ConvoEffect("Blur");
+ imageviewer1.image2=ConvEffect.Filter(imageviewer1.image,this);
+}
+ CurrEffect = new AutoContrast(128,50);
+ CurrEffect.Filter(pixels, width, height,0);
+ CurrEffect = new AutoColor(20);
+ CurrEffect.Filter(pixels, width, height,0);
+ CurrEffect = new AutoBrighten(150,20);
+ CurrEffect.Filter(pixels, width, height,0);
+ ConvEffect = new ConvoEffect("Glow");
+ imageviewer1.image2=ConvEffect.Filter(imageviewer1.image,this);
+
+ imageviewer1.image2 = createImage(new MemoryImageSource(width, height, pixels, 0, width));
+ ConfirmDialog.setVisible(true);
+ ConfirmDialog.setBounds(200,200,220,150);
+ imageviewer1.preview();// TODO add your handling code here:
+}//GEN-LAST:event_AutoEnhanceButtonActionPerformed
+
+ private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
+new h1().setVisible(true); // TODO add your handling code here:
+ }//GEN-LAST:event_jMenuItem1ActionPerformed
+
+ private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
+new about().setVisible(true); // TODO add your handling code here:
+ }//GEN-LAST:event_jMenuItem2ActionPerformed
+
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String args[]) {
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ public void run() {
+ new MainFrame().setVisible(true);
+ }
+ });
+ }
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JInternalFrame AdjModule1;
+ private javax.swing.JButton AutoBrightenButton;
+ private javax.swing.JButton AutoColorButton;
+ private javax.swing.JButton AutoContrastButton;
+ private javax.swing.JButton AutoEnhanceButton;
+ private javax.swing.JPanel AutomaticControlsPanel;
+ private javax.swing.JButton BlueAdjButton;
+ private javax.swing.JButton BlurButton;
+ private javax.swing.JButton BrightenButton;
+ private javax.swing.JButton BumpButton;
+ private javax.swing.JDialog ConfirmDialog;
+ private javax.swing.JButton ContrastButton;
+ private javax.swing.JButton CropButton;
+ private javax.swing.JButton DustFilterButton;
+ private javax.swing.JButton EdgeDetectButton;
+ private javax.swing.JMenu EditMenu;
+ private javax.swing.JButton EmbossButton;
+ private javax.swing.JMenu FileMenu;
+ private javax.swing.JButton GlowButton;
+ private javax.swing.JButton GranulateButton;
+ private javax.swing.JButton GreenAdjButton;
+ private javax.swing.JButton GreyScaleButton;
+ private javax.swing.JButton HueButton;
+ private javax.swing.JButton InvertButton;
+ private javax.swing.JPanel ManualControlsPanel;
+ private javax.swing.JMenuItem OpenMenuItem;
+ private javax.swing.JButton PosterizeButton;
+ private javax.swing.JMenuItem QuitMenuItem;
+ private javax.swing.JButton RedAdjButton;
+ private javax.swing.JButton ResizeButton;
+ private javax.swing.JDialog ResizeDialog;
+ private javax.swing.JButton SaturationButton;
+ private javax.swing.JMenuItem SaveMenuItem;
+ private javax.swing.JButton SharpenButton;
+ private javax.swing.JButton TresholdButton;
+ private javax.swing.JButton jButton16;
+ private javax.swing.JButton jButton17;
+ private javax.swing.JButton jButton27;
+ private javax.swing.JButton jButton28;
+ private javax.swing.JButton jButton5;
+ private javax.swing.JButton jButton6;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel3;
+ private javax.swing.JLabel jLabel4;
+ private javax.swing.JMenuBar jMenuBar1;
+ private javax.swing.JMenuItem jMenuItem1;
+ private javax.swing.JMenuItem jMenuItem2;
+ private javax.swing.JSlider jSlider1;
+ private javax.swing.JSpinner jSpinner1;
+ private javax.swing.JSpinner jSpinner2;
+ // End of variables declaration//GEN-END:variables
+
+ public void stateChanged(ChangeEvent e) {
+ JSlider slider = (JSlider) e.getSource();
+ int value = slider.getValue() - 50;
+
+ int width = imageviewer1.image.getWidth(null);
+ int height = imageviewer1.image.getHeight(null);
+ InitPixels(imageviewer1.image);
+ CurrEffect.Filter(pixels, width, height,value);
+
+ imageviewer1.image2 = createImage(new MemoryImageSource(width, height, pixels, 0, width));
+ imageviewer1.preview();
+
+ }
+ public void mouseClicked(MouseEvent e) {
+ ismouseclicked=1;
+
+ }
+
+ public void mousePressed(MouseEvent e) {
+ mx1=e.getX();
+ my1=e.getY();
+ System.out.println("Pressed at : " + e.getX() + " " +e.getY());
+ }
+
+ public void mouseReleased(MouseEvent e) {
+ mx2=e.getX();
+ my2=e.getY();
+ System.out.println("Released at : " + e.getX() + " " + e.getY());
+ if(crop==1){
+ int width = imageviewer1.image.getWidth(null);
+ int height = imageviewer1.image.getHeight(null);
+
+ bufim = new BufferedImage((int)width,(int)height,BufferedImage.TYPE_INT_RGB);
+
+ Graphics2D g2d = bufim.createGraphics();
+ g2d.drawImage(imageviewer1.image,0,0,this);
+ g2d.draw3DRect(mx1,my1,(mx2-mx1),(my2-my1),true);
+
+ imageviewer1.image2= bufim.getSubimage(mx1,my1,mx2-mx1,my2-my1);
+ ConfirmDialog.setVisible(true);
+ ConfirmDialog.setBounds(200,200,220,150);
+ imageviewer1.setSize(imageviewer1.image2.getWidth(null), imageviewer1.image2.getHeight(null));
+
+ imageviewer1.preview();
+
+
+ crop=0;
+ }
+
+ }
+
+ public void mouseEntered(MouseEvent e) {
+ }
+
+ public void mouseExited(MouseEvent e) {
+ }
+}
diff --git a/src/imageapplication/about.form b/src/imageapplication/about.form
new file mode 100644
index 0000000..894f7ae
--- /dev/null
+++ b/src/imageapplication/about.form
@@ -0,0 +1,80 @@
+
+
+
diff --git a/src/imageapplication/about.java b/src/imageapplication/about.java
new file mode 100644
index 0000000..8987419
--- /dev/null
+++ b/src/imageapplication/about.java
@@ -0,0 +1,86 @@
+/*
+ * about.java
+ *
+ * Created on 22 March, 2009, 1:02 PM
+ */
+
+package imageapplication;
+
+/**
+ *
+ * @author ashes
+ */
+public class about extends javax.swing.JFrame {
+
+ /** Creates new form about */
+ public about() {
+ initComponents();
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jScrollPane1 = new javax.swing.JScrollPane();
+ jTextArea1 = new javax.swing.JTextArea();
+ jLabel1 = new javax.swing.JLabel();
+
+ setTitle("About us ");
+
+ jTextArea1.setBackground(new java.awt.Color(255, 255, 204));
+ jTextArea1.setColumns(20);
+ jTextArea1.setEditable(false);
+ jTextArea1.setFont(new java.awt.Font("Purisa", 1, 18));
+ jTextArea1.setRows(5);
+ jTextArea1.setText("Auto Image Enhancement and Restoration is \na graphical image editor. This project is implemented\nas a part of Software Engineering Lab by 3 year\nComputer Engineering B.Tech students\nAbhirup Dutta\nAshish G Bhat \nGovind Krishna\nunder the guidance of Shri Mahendra Pratap Singh. \n ");
+ jTextArea1.setCaretColor(new java.awt.Color(153, 0, 0));
+ jScrollPane1.setViewportView(jTextArea1);
+
+ jLabel1.setBackground(new java.awt.Color(255, 102, 51));
+ jLabel1.setText("ABOUT US: ");
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 318, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(423, Short.MAX_VALUE))
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 753, Short.MAX_VALUE)
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 29, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(90, 90, 90))
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String args[]) {
+ java.awt.EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ new about().setVisible(true);
+ }
+ });
+ }
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JTextArea jTextArea1;
+ // End of variables declaration//GEN-END:variables
+
+}
diff --git a/src/imageapplication/h1.form b/src/imageapplication/h1.form
new file mode 100644
index 0000000..519971d
--- /dev/null
+++ b/src/imageapplication/h1.form
@@ -0,0 +1,165 @@
+
+
+
diff --git a/src/imageapplication/h1.java b/src/imageapplication/h1.java
new file mode 100644
index 0000000..be658ea
--- /dev/null
+++ b/src/imageapplication/h1.java
@@ -0,0 +1,153 @@
+/*
+ * h1.java
+ *
+ * Created on 30 March, 2009, 8:35 PM
+ */
+
+package imageapplication;
+
+/**
+ *
+ * @author ashes
+ */
+public class h1 extends javax.swing.JFrame {
+
+ /** Creates new form h1 */
+ public h1() {
+ initComponents();
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ buttonGroup1 = new javax.swing.ButtonGroup();
+ jScrollPane1 = new javax.swing.JScrollPane();
+ jTextArea1 = new javax.swing.JTextArea();
+ jRadioButton1 = new javax.swing.JRadioButton();
+ jRadioButton2 = new javax.swing.JRadioButton();
+ jLabel1 = new javax.swing.JLabel();
+ jScrollPane2 = new javax.swing.JScrollPane();
+ jTextArea2 = new javax.swing.JTextArea();
+ jRadioButton3 = new javax.swing.JRadioButton();
+ jRadioButton4 = new javax.swing.JRadioButton();
+
+ setTitle("Using AUTOIM-PRO");
+ setBackground(new java.awt.Color(255, 255, 102));
+
+ jTextArea1.setBackground(new java.awt.Color(255, 254, 196));
+ jTextArea1.setColumns(20);
+ jTextArea1.setEditable(false);
+ jTextArea1.setRows(5);
+ jTextArea1.setText("**********************\nAUTOMATIC OPTIONS\n**********************\nThe vital and important features of this product \nAutomatic Operations which include\n>AUTO BRIGHTNESS\n>AUTO CONTRAST \n>AUTO COLOR\n>AUTO Enhancement\n*****************\nOPENING A FILE:\n*****************\nFile > Open \n or\nhotkey : Ctrl+O\n *****************\nSAVING A FILE\n******************\nFile > Save \n or \nhotkey : Ctrl+O\n**********************\nIMAGE Enhancement\n**********************\nSelect the desired image enhancements you desire to\nperform on your image and slide the mouse pointer. \nThe slider moving towards right indicates greater \nvalue of enhancement and towards the left indicates\nlesser value.\nFor example :\n>Click on BRIGHTNESS button\n>To increase brightness, move the slider towards right.\n>To decrease brightness, move the slider towards left.\n\n***********************\nIMAGE transformation \n***********************\nRESIZE Image\n>Click on the resize button.\n>Specify the size i.e. height and width to resize the\n image.\n");
+ jScrollPane1.setViewportView(jTextArea1);
+
+ jRadioButton1.setText("OPEN/SAVING A FILE");
+
+ jRadioButton2.setText("IMAGE Enhancements");
+ jRadioButton2.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jRadioButton2ActionPerformed(evt);
+ }
+ });
+
+ jLabel1.setText("CONTENTS");
+
+ jTextArea2.setColumns(20);
+ jTextArea2.setEditable(false);
+ jTextArea2.setFont(new java.awt.Font("URW Gothic L", 2, 18));
+ jTextArea2.setForeground(new java.awt.Color(0, 102, 0));
+ jTextArea2.setRows(5);
+ jTextArea2.setText("Brightness\nContrast\nGreyscale\nColor Invert\nPosterize\nThreshold\nSharpen\nBlur\nBump\nHue saturation");
+ jScrollPane2.setViewportView(jTextArea2);
+
+ buttonGroup1.add(jRadioButton3);
+ jRadioButton3.setText("AUTOMATIC Enhancements");
+
+ jRadioButton4.setText("IMAGE transformations");
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addGap(17, 17, 17)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jRadioButton2)
+ .addComponent(jRadioButton1)
+ .addComponent(jRadioButton3)
+ .addComponent(jRadioButton4))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addGroup(layout.createSequentialGroup()
+ .addGap(82, 82, 82)
+ .addComponent(jLabel1)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
+ .addGap(34, 34, 34))
+ .addGroup(layout.createSequentialGroup()
+ .addGap(77, 77, 77)
+ .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 436, javax.swing.GroupLayout.PREFERRED_SIZE))
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 480, Short.MAX_VALUE)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel1)
+ .addGap(28, 28, 28)
+ .addComponent(jRadioButton3)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(jRadioButton1)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(jRadioButton2)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 248, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(18, 18, 18)
+ .addComponent(jRadioButton4)))
+ .addContainerGap())
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton2ActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_jRadioButton2ActionPerformed
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String args[]) {
+ java.awt.EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ new h1().setVisible(true);
+ }
+ });
+ }
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.ButtonGroup buttonGroup1;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JRadioButton jRadioButton1;
+ private javax.swing.JRadioButton jRadioButton2;
+ private javax.swing.JRadioButton jRadioButton3;
+ private javax.swing.JRadioButton jRadioButton4;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JScrollPane jScrollPane2;
+ private javax.swing.JTextArea jTextArea1;
+ private javax.swing.JTextArea jTextArea2;
+ // End of variables declaration//GEN-END:variables
+
+}