-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAestheticsTransformation.java
More file actions
63 lines (48 loc) · 4.03 KB
/
AestheticsTransformation.java
File metadata and controls
63 lines (48 loc) · 4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import com.cloudinary.Api;
import com.cloudinary.Cloudinary;
import com.cloudinary.Transformation;
import com.cloudinary.transformation.Layer;
import com.cloudinary.transformation.TextLayer;
class AestheticsTransformations {
//Cloudinary cloudinary=new Cloudinary("cloudinary://549185954311254:LQwYOwL9Ij9ioS6lCCwdB5K7ErY@aditimadan");
//Environment env= new Environment();
Cloudinary cloudinary=new Cloudinary(Environment.url);
Api api=cloudinary.api();
public void printTransformation(){
//Radius rounded corners and transparent background
System.out.println(cloudinary.url().transformation(new Transformation().width(300).height(300).crop("thumb").gravity("auto").fetchFormat("auto").quality("auto").radius("max")).imageTag("dog.jpg"));
//Borders '10px_solid_rgb:bde4fb'
//System.out.println(cloudinary.url().transformation(new Transformation().border("10px_solid_rgb:bde4fb").width(300).height(300).crop("thumb").gravity("auto").fetchFormat("auto").quality("auto").radius("max")).imageTag("dog.jpg"));
//crop pad to capture full image with padding to prevent skew
//change AR vertical to horizontal
//System.out.println(cloudinary.url().transformation(new Transformation().width(300).height(300).crop("thumb").gravity("auto").fetchFormat("auto").quality("auto").radius("max").background("red")).imageTag("face.jpg"));
//Effects and Filters
//color tint
//System.out.println(cloudinary.url().transformation(new Transformation().width(300).height(300).crop("thumb").gravity("face").fetchFormat("auto").quality("auto").radius("max").effect("tint:40:magenta")).imageTag("face.jpg"));
//Duotone: chained transformation grayscale + tint
//System.out.println(cloudinary.url().transformation(new Transformation().width(300).height(300).crop("thumb").gravity("face").fetchFormat("auto").quality("auto").radius("max").effect("grayscale")
// .chain().effect("tint:40:magenta").fetchFormat("auto").quality("auto")).imageTag("face.jpg"));
//Outline effect for transparent images
//System.out.println(cloudinary.url().transformation(new Transformation().width(300).crop("scale").quality("auto").effect("outline:15").color("orange")).imageTag("blackberry.jpg"));
//Improve color, contrast, lightness
//System.out.println(cloudinary.url().transformation(new Transformation().width(300).height(300).crop("thumb").gravity("auto").fetchFormat("auto").quality("auto").radius("max").effect("improve:outdoor")).imageTag("blackberry.jpg"));
//Art Filters
//Zorro
//System.out.println(cloudinary.url().transformation(new Transformation().width(300).height(300).crop("thumb").gravity("auto").fetchFormat("auto").quality("auto").effect("art:zorro")).imageTag("lake.jpg"));
//Cartoonify
//System.out.println(cloudinary.url().transformation(new Transformation().width(300).height(300).crop("thumb").gravity("auto").fetchFormat("auto").quality("auto").effect("cartoonify")).imageTag("lake.jpg"));
//Overlay
//Text over image
//System.out.println(cloudinary.url().transformation(new Transformation().width(300).height(300).crop("thumb")
//.chain().overlay(new TextLayer().fontFamily("Arial").text("Tutoring").fontSize(30)).background("white").color("blue").gravity("north_west").x(10).y(10)).imageTag("faces.jpg"));
// Image over image
//System.out.println(cloudinary.url().transformation(new Transformation().width(300).height(300).crop("thumb")
// .chain().overlay(new Layer().publicId("logo")).height("50").gravity("south_west").x(10).y(10)).imageTag("faces.jpg"));
// Text over video
//System.out.println(cloudinary.url().resourceType("video").transformation(new Transformation().width(300).crop("scale")
//.chain().overlay(new TextLayer().fontFamily("Arial").text("Earth").fontSize(30)).background("white").color("blue").gravity("north_west").x(10).y(10)).imageTag("video.mp4"));
// Image over video
//System.out.println(cloudinary.url().resourceType("video").transformation(new Transformation().width(400).crop("scale")
// .chain().overlay(new Layer().publicId("logo")).height("50").gravity("north_west").x(10).y(10)).imageTag("video.mp4"));
}
}