GithubHelp home page GithubHelp logo

Comments (2)

kwcckw avatar kwcckw commented on May 28, 2024

This should be possible by adding certain level of gradient in the edges of the outline, but in actual use case, i think we need to get some templates of those seals? Otherwise it might not be easy to create those seals from scratch.

from augraphy.

jboarman avatar jboarman commented on May 28, 2024

We have a draft set of stamps that could be integrated for use with this proposed augmentation, but that will need to be packaged for download separately, possibly on zonodo. Nevertheless, a user will need to reference a set of images within a folder, or possibly an existing set that we may offer via URL to download via zonodo or figshare, etc.

Filters and Post-Processing

Below are possible filters that may be useful to create a debossed or embossed representation of the stamp that could then be colorized and blended into the ink layer.

The use of course-grained noise would help make the impression look more natural when blended with the page. We may also want to borrow some of the letterpress functionality to blend ink-based stamps as well.

Note that colorized stamps would represent ink-pressed stamps while a semi-transparent white(?) stamp would represent an impression pressed into the paper to raise/low the paper instead of being combined with ink. Both stamps and seal can have the embossed or debossed impression effect. So a color and alpha transparency level associated with color could be passed in as a parameter or randomized (see markup augmentation and overlaybuilder utility for reference implementations).

Both scipy or opencv are dependencies that offer the convolutions. We may want to compare speeds, but if it's a toss-up then we should stick with opencv for consistency with the majority of our existing code:

opencv:
debossed_image = cv2.filter2D(img, -1, kernel_deboss, borderType=cv2.BORDER_REFLECT)

scipi:
embossed_image = convolve2d(image, kernel_emboss, mode='same', boundary='symm')

Deboss filters

# Deboss filter kernel variation 1
kernel_deboss_1 = np.array([[-1, -1, -1],
                            [-1, 9, -1],
                            [-1, -1, -1]])

# Deboss filter kernel variation 2
kernel_deboss_2 = np.array([[0, -2, -2],
                            [2, 0, -2],
                            [2, 2, 0]])

# Deboss filter kernel variation 3
kernel_deboss_3 = np.array([[-1, -2, -1],
                            [-2, 12, -2],
                            [-1, -2, -1]])

Emboss filters

# Emboss filter kernel variation 1
kernel_emboss_1 = np.array([[-1, -1, 0],
                            [-1, 0, 1],
                            [0, 1, 1]])

# Emboss filter kernel variation 2
kernel_emboss_2 = np.array([[0, 1, 0],
                            [1, -4, 1],
                            [0, 1, 0]])

# Emboss filter kernel variation 3
kernel_emboss_3 = np.array([[-2, -1, 0],
                            [-1, 0, 1],
                            [0, 1, 2]])

from augraphy.

Related Issues (20)

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.