import Myro.*; public class MyroPicture { private MyroImage image; public MyroPicture() { boolean success; image = new MyroColorImage(); success = image.loadImage("cat.jpg"); if( !success ) { MyroGUI.tellUser("Error Opening Image File"); } else { image.show(); makeGrey(); blur(4); shrink(3.2); expand(1.5); //findCenter() } } private void makeGrey() { MyroImage newImage = new MyroColorImage( image.getWidth(), image.getHeight()); for( int x=0; x= 0 && row < image.getWidth() && col >= 0 && col < image.getHeight()) { MyroPixel p = image.getPixel( row, col ); sum += p.getGray(); count++; } } } newImage.getPixel(x,y).setGray((int)(sum/(double)count)); } } newImage.show("smoothed(" + toAveOver + ")"); } //shrink the image by a factor of shrink and display as a new picture private void shrink(double shrink) { int oldWidth = image.getWidth(); int oldHeight = image.getHeight(); int newWidth = (int)((double)oldHeight / shrink); int newHeight = (int)((double)oldHeight / shrink); MyroImage newImage = new MyroColorImage( newWidth, newHeight ); //Now, go through each pixel in the image and figure out where it should go in the newImage for( int x=0; x