Advertisement
Guest User

Untitled

a guest
May 2nd, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. import java.awt.*;import java.io.File;import static javax.imageio.ImageIO.*;class Q{public static void main(String[]v)throws Exception{File f=new File(v[2]);java.awt.image.BufferedImage b=read(f);for(int i=0,j,h=b.getHeight(),w=b.getWidth();i<h;i++)for(j=0;j<w;){Color c=new Color(b.getRGB(j,i));float[]a=new float[3];c.RGBtoHSB(c.getRed(),c.getGreen(),c.getBlue(),a);b.setRGB(j++,i,c.HSBtoRGB((a[0]+Float.valueOf(v[1])/360+(i*w+j)*Float.valueOf(v[0])/w/h)%1,a[1],a[2]));}write(b,"png",f);}}
  2.  
  3. import java.awt.*;
  4. import java.io.File;
  5.  
  6. import static javax.imageio.ImageIO.*;
  7.  
  8. class A79200 {
  9. public static void main(String[] v) throws Exception {
  10. File file = new File(v[2]);
  11. java.awt.image.BufferedImage image = read(file);
  12. for (int i = 0, j, height = image.getHeight(), width = image.getWidth(); i < height; i++)
  13. for (j = 0; j < width; ) {
  14. Color color = new Color(image.getRGB(j, i));
  15. float[] arr = new float[3];
  16. color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), arr);
  17. image.setRGB(j++, i, color.HSBtoRGB((arr[0] + Float.valueOf(v[1]) / 360 + (i * width + j) * Float.valueOf(v[0]) / width / height) % 1, arr[1], arr[2]));
  18. }
  19. write(image, "png", file);
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement