Skip to content
Yusuf Shakeel edited this page Jul 8, 2014 · 41 revisions

Welcome to the Java-Image-Processing-Project wiki!

DY imageFX - Image Processing project

By: Yusuf Shakeel

Date: 26-Jan-2014 Sunday

URL:

facebook.com/yusufshakeel

youtube.com/yusufshakeel

plus.google.com/+YusufShakeel

github.com/yusufshakeel

yusufshakeelblog.blogspot.in


Note

This project is in development stage so files will get modified quite often.

I have used Netbeans IDE 7.3.1 for this project. It is a free software and you can download it from netbeans.org.

Content

Download DYimageFX-jar file to use it in your project.

Download DYimageFX-javadoc for more details.

You can also download the entire project code.

Using DYimageFX jar file in your project

How to use the jar file in your project?

  1. Download the DYimageFX-.jar file.
  2. Add the jar file in the class path of your IDE [NetBeans, JCreator etc]
  3. Write import dyimagefx.*; to import the classes and packages.

This video will help you to add JAR file in your JAVA project in NetBeans IDE NetBeans | How to add JAR file in JAVA project

For instance, if you want to import the dyimagefx classes inside your Test.java file, then write the following line

import dyimagefx.*;

inside your Test.java file.

So your Test.java file may look something like this

import java.io.*;

import dyimagefx.*;

public class Test{

    //your code goes here...

}//class Test ends here

How to create MyImage object?

Following are the ways of creating MyImage object.

MyImage iobj = new MyImage();

This will create an object iobj whose dimension is still not initialized. This is useful if you already have an image on your computer and want to store that image in iobj.

MyImage iobj = new MyImage(100,200);

This will create an object iobj of dimension 100x200. This is useful if you want to create your own image or want to generate a random image.

MyImage iobjClone = new MyImage(iobj);

This will create an object iobjClone which will be a clone of an already created object iobj.

How to read an image file?

1.Create MyImage object.

MyImage iobj = new MyImage();

2.Read the image file. For instance, if you want to read Taj.jpg image file which is in D: then type

iobj.readImage("D:\\Taj.jpg");

Now you are ready to perform image processing operations.

How to create a random image?

1.Create MyImage object. For instance, if you want to have an image of width 100 and height 200 type the following

MyImage iobj = new MyImage(100,200);

2.Call the createRandomImage() method of ImageFX class. This will create a random image.

ImageFX.createRandomImage(iobj);

How to write an image to a file?

Writing an image to a file is very simple. For instance, consider that you have created a MyImage object iobj and have created a random image and now you want to save your image in D: by the name Pic.jpg. For this you have to write the following line

iobj.writeImage("D:\\Pic.jpg");

Similarly, if you want to save your image in D: by the name Pic.png then you have to write

iobj.writeImage("D:\\Pic.png");