Giter Site home page Giter Site logo

imagemarker's Introduction

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() 메소드로 결과 인스턴스를 받습니다.)

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

imagemarker's People

Contributors

yjham2002 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

barakethan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.