Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);}}
- import java.awt.*;
- import java.io.File;
- import static javax.imageio.ImageIO.*;
- class A79200 {
- public static void main(String[] v) throws Exception {
- File file = new File(v[2]);
- java.awt.image.BufferedImage image = read(file);
- for (int i = 0, j, height = image.getHeight(), width = image.getWidth(); i < height; i++)
- for (j = 0; j < width; ) {
- Color color = new Color(image.getRGB(j, i));
- float[] arr = new float[3];
- color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), arr);
- 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]));
- }
- write(image, "png", file);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement