Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding augmentations for primitive geometric operations? #20

Closed
proofconstruction opened this issue Jul 8, 2021 · 4 comments
Closed
Labels
composability Approaches to designing the interrelationship of applied augmentations discussion Open dialog about how we can approach and solve various issues

Comments

@proofconstruction
Copy link
Collaborator

proofconstruction commented Jul 8, 2021

As part of the effort to make a set of core augmentations that others can be built from, we’ll want augmentations to handle some basic geometric operations:

  1. Rotating (turning a layer by some degree/radian)
  2. Translating (shifting a layer in some direction, by some amount)
  3. Scaling (magnifying or shrinking a layer)
  4. Inverting (flipping a layer across some axis)

It would probably also be useful if these operations could happen to a region in a layer, instead of only the entire layer.

Together, these could be composed to form augmentations that simulate common deformations occurring to real documents:

  1. Printer feeder suffered mechanical failure and printed text diagonally before getting jammed
  2. Printer head got stuck and printed only on one side of the page
  3. Accidentally printed the wrong font size
  4. Accidentally printed in 2-column brochure-mode so each half of the page is oriented opposite the other
@jboarman jboarman changed the title Add augmentations for primitive geometric operations Adding augmentations for primitive geometric operations? Jul 8, 2021
@jboarman jboarman added discussion Open dialog about how we can approach and solve various issues composability Approaches to designing the interrelationship of applied augmentations labels Jul 8, 2021
@jboarman
Copy link
Sponsor Member

jboarman commented Jul 8, 2021

This gets to the heart of how we formulate our philosophical approach to composing augmentation functionality. I believe @kwcckw had some comments that similarly touch on how we compose some fundamental augmentations.

For example, issue #11 aims to combine two fundamental augmentations into a single augmentation that has an identifiable purpose and effect. The aim of #11 is to make augmentations more user friendly to the casual user.

But, what if we want to re-use that "dusty ink" effect in some other way on another augmentation?

I propose that composition occurs in (at least) 3 different levels:

  1. library of utility python functions that can be re-used between various augmentations
  2. augmentations
  3. pipelines

The casual Augraphy user will leverage the default pipeline. A slightly more advanced user will compose their own pipeline from available augmentations. The most advanced user will create custom augmentations in their own code that is added to a custom pipeline.

I believe there is an additional level of composability that I don't think we have approached, which is to compose pipelines using other pipelines. So, for example, perhaps there is a "Letterpress" pipeline (instead of a "Letterpress" augmentation). That pipeline might leverage dusty ink and ink blobs augmentations. Then, a pipeline might pull in the "Letterpress" pipeline as a OneOf sequence that is invoked from their own custom pipeline.

Anyhow, before we get too much further, we need to formulate a consensus opinion on how we can balance having a set of user-friendly and easily-identifiable purpose-driven augmentations vs micro augmentations that must be mixed and matched to compose a particular effect.

@kwcckw
Copy link
Collaborator

kwcckw commented Jul 9, 2021

I propose that composition occurs in (at least) 3 different levels:

1. library of utility python functions that can be re-used between various augmentations

2. augmentations

3. pipelines

Yes, i think this is important since some augmentations may redundant to each other. Additionally, is there a better way to avoid those same redundant augmentation?
For example, in #11 , we are merging dusty ink and ink blob in ink phase, so there shouldn't be anymore dusty ink and ink blob augmentation in ink phase.

@proofconstruction
Copy link
Collaborator Author

I wrote some thoughts on future directions in #22 - in short, I think we should end up with a small set of useful augmentations to show the utility of the package (things like paper fold, ink bleed, scanner lines, etc.), but also provide easier ways to combine and extend existing features (at the different levels mentioned above), and to add new features where desired.

@jboarman
Copy link
Sponsor Member

I'm closing this issue since #25 covers at least half of the concern raised here. Topics of composition are being adequately discussed elsewhere. The mechanical deformations proposed are good ones that should be independently proposed on a per-transform basis along with examples of the expected output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
composability Approaches to designing the interrelationship of applied augmentations discussion Open dialog about how we can approach and solve various issues
Projects
None yet
Development

No branches or pull requests

3 participants