https://github.com/yjham2002/imagemarker
:camera: A library for marking watermark with image or text on source image and returning as BufferedImage
https://github.com/yjham2002/imagemarker
bufferedimage jar
Last synced: 3 months ago
JSON representation
:camera: A library for marking watermark with image or text on source image and returning as BufferedImage
- Host: GitHub
- URL: https://github.com/yjham2002/imagemarker
- Owner: yjham2002
- Created: 2017-01-16T04:16:15.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-18T01:06:48.000Z (over 8 years ago)
- Last Synced: 2025-01-06T14:41:24.631Z (5 months ago)
- Topics: bufferedimage, jar
- Language: Java
- Homepage:
- Size: 1.26 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ImageMarker(이미지마커)
- A library for marking watermark with image or text on source image and returning as BufferedImage.
- 소스 이미지에 대해 이미지 기반의 워터마크 혹은 텍스트를 삽입할 수 있는 라이브러리.
#### Usage
- Add ImageMarker.jar to your project. (ImageMarker.jar 파일을 다운로드하여 프로젝트에 삽입합니다.)
- Set option simply with inner method. (아래 코드 스니펫과 같은 방법으로 옵션을 설정합니다.)
- Get final result with simply using toBufferedImage() method. (toBufferedImage() 메소드로 결과 인스턴스를 받습니다.)
```java
public static void main(String[] args) throws IOException{
BufferedImage originalImage = ImageIO.read(new File("C:\\Users\\a\\IdeaProjects\\ImageMarker\\or.png"));
BufferedImage waterImage = ImageIO.read(new File("C:\\Users\\a\\IdeaProjects\\ImageMarker\\water.png"));/**
* Type : Singleton Pattern instance
* Set Attributes with Decorator Pattern Style
* */
ImageMarker imageMarker = ImageMarker.getInstance();
BufferedImage result = imageMarker
.of(originalImage)
.alpha(0.5f)
.font(new Font("malgun gothic", Font.BOLD, 100))
.caption("Caption Text")
.subFont(new Font("malgun gothic", Font.ITALIC, 30))
.subCaption("SubScript Text")
.waterMark(waterImage)
.setAsIntrinsicWaterMark()
.outputFormat("png")
.alphaOfCaption(0.5f)
.subTopMargin(10)
.position(ImageMarker.CENTER)
.captionColor(Color.WHITE)
.toBufferedImage();ImageIO.write(result, "png", new File("result.png"));
}
```#### License
- Thumbnailator [on Github](https://github.com/coobird/thumbnailator)