com.aviyehuda.easyimage
Class Image

java.lang.Object
  extended by com.aviyehuda.easyimage.Image

public class Image
extends java.lang.Object

EasyImage lets you do all the basic image operations - converting, cropping, resizing, rotating, flipping… Plus it let’s you do some really cool affects. All is done super easily. Combining operations can produce some very cool results. Operations: Open image. Save image Convert image Re-size image Crop image Convert to black and white image Rotate image Flip image Add color to image Create image with multiple instance of the original Combining 2 images together Emphasize parts of the image Affine transform image

Author:
Avi Yehuda

Constructor Summary
Image(java.io.File imageFile)
          Constructor - loads from an image file.
Image(java.lang.String imageFilePath)
          Constructor - loads from an image file.
 
Method Summary
 void addColorToImage(java.awt.Color color, int jump)
           
 void addColorToImage(int rgb, int jump)
           
 void addPixelColor(int numToAdd)
          Add color to the RGB of the pixel
 void affineTransform(double fShxFactor, double fShyFactor)
           
 void combineWithPicture(Image image2)
           
 void combineWithPicture(Image image2, java.awt.Color ignoreColor)
           
 void combineWithPicture(Image image2, int jump)
           
 void combineWithPicture(Image image2, int jump, java.awt.Color ignoreColor)
           
 void combineWithPicture(java.lang.String newImagePath)
          Combines the image with another image in an equal presence to both;
 void combineWithPicture(java.lang.String newImagePath, int jump)
          Combines the image with another image.
 void convertToBlackAndWhite()
          Covert image to black and white.
 void crop(int startX, int startY, int endX, int endY)
           
 void emphasize(int startX, int startY, int endX, int endY)
           
 void emphasize(int startX, int startY, int endX, int endY, java.awt.Color backgroundColor)
           
 void emphasize(int startX, int startY, int endX, int endY, java.awt.Color backgroundColor, int jump)
           
 void emphasize(int startX, int startY, int endX, int endY, int jump)
           
 void flipHorizontally()
          Flips the image horizontally
 void flipVertically()
          Flips the image vertically.
 java.awt.image.BufferedImage getAsBufferedImage()
          Return image as java.awt.image.BufferedImage
 int getHeight()
           
 int getWidth()
           
static void main(java.lang.String[] args)
           
 void multiply(int timesToMultiplyVertically, int timesToMultiplyHorizantelly)
          Multiply the image.
 void multiply(int timesToMultiplyVertically, int timesToMultiplyHorizantelly, int colorToHenhancePerPixel)
          Multiply the image and also add color each of the multiplied images.
 void resize(int percentOfOriginal)
          Resizing the image by percentage of the original.
 void resize(int newWidth, int newHeight)
          Resizing the image by width and height.
 void rotate180()
          Rotates image 180 degrees.
 void rotateLeft()
          Rotates image 90 degrees to the left.
 void rotateRight()
          Rotates image 90 degrees to the right.
 void save()
          Saves the image to the original file.
 void saveAs(java.lang.String fileName)
          Save the image as a new image file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Image

public Image(java.io.File imageFile)
Constructor - loads from an image file.

Parameters:
imageFile -

Image

public Image(java.lang.String imageFilePath)
Constructor - loads from an image file.

Parameters:
imageFilePath -
Method Detail

getAsBufferedImage

public java.awt.image.BufferedImage getAsBufferedImage()
Return image as java.awt.image.BufferedImage

Returns:
image as java.awt.image.BufferedImage

saveAs

public void saveAs(java.lang.String fileName)
Save the image as a new image file. Can also convert the image according to file type.

Parameters:
fileName -

save

public void save()
Saves the image to the original file.


resize

public void resize(int percentOfOriginal)
Resizing the image by percentage of the original.

Parameters:
percentOfOriginal -

resize

public void resize(int newWidth,
                   int newHeight)
Resizing the image by width and height.

Parameters:
newWidth -
newHeight -

addPixelColor

public void addPixelColor(int numToAdd)
Add color to the RGB of the pixel

Parameters:
numToAdd -

convertToBlackAndWhite

public void convertToBlackAndWhite()
Covert image to black and white.


rotateLeft

public void rotateLeft()
Rotates image 90 degrees to the left.


rotateRight

public void rotateRight()
Rotates image 90 degrees to the right.


rotate180

public void rotate180()
Rotates image 180 degrees.


flipHorizontally

public void flipHorizontally()
Flips the image horizontally


flipVertically

public void flipVertically()
Flips the image vertically.


multiply

public void multiply(int timesToMultiplyVertically,
                     int timesToMultiplyHorizantelly)
Multiply the image.

Parameters:
timesToMultiplyVertically -
timesToMultiplyHorizantelly -

multiply

public void multiply(int timesToMultiplyVertically,
                     int timesToMultiplyHorizantelly,
                     int colorToHenhancePerPixel)
Multiply the image and also add color each of the multiplied images.

Parameters:
timesToMultiplyVertically -
timesToMultiplyHorizantelly -

combineWithPicture

public void combineWithPicture(java.lang.String newImagePath)
Combines the image with another image in an equal presence to both;

Parameters:
newImagePath - - image to combine with

combineWithPicture

public void combineWithPicture(java.lang.String newImagePath,
                               int jump)
Combines the image with another image. jump = 2 means that every two pixels the new image is replaced. This makes the 2 images equal in presence. If jump=3 than every 3rd pixel is replaced by the new image. As the jump is higher this is how much the new image has less presence.

Parameters:
newImagePath -
jump -

combineWithPicture

public void combineWithPicture(Image image2)

combineWithPicture

public void combineWithPicture(Image image2,
                               int jump)

combineWithPicture

public void combineWithPicture(Image image2,
                               java.awt.Color ignoreColor)

combineWithPicture

public void combineWithPicture(Image image2,
                               int jump,
                               java.awt.Color ignoreColor)

crop

public void crop(int startX,
                 int startY,
                 int endX,
                 int endY)

emphasize

public void emphasize(int startX,
                      int startY,
                      int endX,
                      int endY)

emphasize

public void emphasize(int startX,
                      int startY,
                      int endX,
                      int endY,
                      java.awt.Color backgroundColor)

emphasize

public void emphasize(int startX,
                      int startY,
                      int endX,
                      int endY,
                      int jump)

emphasize

public void emphasize(int startX,
                      int startY,
                      int endX,
                      int endY,
                      java.awt.Color backgroundColor,
                      int jump)

addColorToImage

public void addColorToImage(java.awt.Color color,
                            int jump)

addColorToImage

public void addColorToImage(int rgb,
                            int jump)

affineTransform

public void affineTransform(double fShxFactor,
                            double fShyFactor)

getWidth

public int getWidth()

getHeight

public int getHeight()

main

public static void main(java.lang.String[] args)