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

New feature: Gradient patterns #1334

Merged
merged 18 commits into from
Jan 5, 2025
Merged

Conversation

andersonhc
Copy link
Collaborator

@andersonhc andersonhc commented Dec 24, 2024

e.g. Fixes #0

Checklist:

  • Implement linear and radial gradients (Pattern/Shading)

  • Implement a class to handle named resources better

  • A unit test is covering the code added

  • A mention of the change is present in CHANGELOG.md

  • Docstrings have been added

  • Documentation created in the docs/ folder

  • This PR is ready to be merged

By submitting this pull request, I confirm that my contribution is made under the terms of the GNU LGPL 3.0 license.

@Lucas-C
Copy link
Member

Lucas-C commented Dec 24, 2024

Hi @andersonhc 🙂

This is related to #790?

Thank you for tackling this!

And wish you a merry christmas 🎅🎄

@andersonhc
Copy link
Collaborator Author

Hi @andersonhc 🙂

This is related to #790?

Thank you for tackling this!

And wish you a merry christmas 🎅🎄

There are 2 types of patterns on the PDF specs. Type 1 (tiling patterns) are the repetition of images or text and type 2 (shading patterns) are gradients.

I am only implementing gradients for now because I need this feature to proceed with #1305.

I will comment on #790 to detail what has been done and what's missing to implement tiling patterns.

This PR also open a path to implement the LinearGradient and RadialGradient SVG features, we can open a issue for that.

Merry Christmas to you too. Enjoy the holidays.

@Lucas-C
Copy link
Member

Lucas-C commented Dec 27, 2024

There are 2 types of patterns on the PDF specs. Type 1 (tiling patterns) are the repetition of images or text and type 2 (shading patterns) are gradients.

I am only implementing gradients for now because I need this feature to proceed with #1305.

I will comment on #790 to detail what has been done and what's missing to implement tiling patterns.

Awesome!
Thank you for the explanation 👍

fpdf/fpdf.py Outdated Show resolved Hide resolved
fpdf/pattern.py Outdated Show resolved Hide resolved
@Lucas-C
Copy link
Member

Lucas-C commented Dec 27, 2024

I rebased this branch onto master.

I made a few comments but I also approved this PR 👍

fpdf2 Outdated Show resolved Hide resolved
fpdf/fpdf.py Outdated Show resolved Hide resolved
@andersonhc andersonhc merged commit e54b066 into py-pdf:master Jan 5, 2025
16 checks passed
@andersonhc
Copy link
Collaborator Author

@Lucas-C

FYI:

  • I produced a new reference file for test_insert_jpg_jpxdecode because of changes for JPEG2000 images after pillow 11.1.0
  • I also had to skip this test on python 3.8 because pillow dropped this version.

@Lucas-C
Copy link
Member

Lucas-C commented Jan 6, 2025

Good job on this @andersonhc! 👍

Congrats, really nice addition 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants