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

Adjust compression level of background (different color page edges) #11

Open
top-rated opened this issue Oct 24, 2024 · 9 comments
Open

Comments

@top-rated
Copy link

Hi! My carousel template for your amazing tool requires single color background that has to be exactly the same on the page edges as well. However, either export, LinkedIn import or both compress it in a way that page edges are a bit different color. If it's something that can be changed, could you please forward me into the right direction? Thanks! Regards, Dan.

@FranciscoMoretti
Copy link
Owner

Hi @top-rated ! Yes, there is a compression setting. Can you share an example of the issue?

@FranciscoMoretti
Copy link
Owner

@top-rated
Copy link
Author

top-rated commented Oct 30, 2024 via email

@FranciscoMoretti
Copy link
Owner

Hey @top-rated ! First, thanks for using this project in real life! Super exciting to see that.

I think I got the gist of what you are trying to achieve.

I checked the background of LinkedIn carousel element in light mode and it seems to be this value on my browser:

  • rgb(220, 230, 241)

image

Your carousel background seems to be:

  • rgb(237, 241, 252)

Can you try to set 220, 230, 241 as the background color?

Note: there is some shadow to it that changes with different swipe directions. That's not accounted.

  • small shadow on the left
  • large shadow on the right

image

@top-rated
Copy link
Author

top-rated commented Oct 31, 2024 via email

@FranciscoMoretti
Copy link
Owner

Seems your attachment didn't go through. I tried setting that background color and printing to PDF and the end result is decent.

After conversion it shows (220, 230, 241) -> (220, 230, 240) which should be almost unnoticeable.

image

LinkedIn changes it like this (on the preview) (220, 230, 240) -> (222, 229, 241)

Which is off, but not as much as your example post (237, 241, 252)

image

Not sure how to solve this problem. I suggest you try with different image formats in this line https://github.com/FranciscoMoretti/carousel-generator/blob/main/src/lib/hooks/use-component-printer.tsx#L169

@top-rated
Copy link
Author

top-rated commented Nov 1, 2024 via email

@FranciscoMoretti
Copy link
Owner

Thanks for the additional info:

  1. Change this line https://github.com/FranciscoMoretti/carousel-generator/blob/main/src/lib/hooks/use-component-printer.tsx#L169 by using options from toDataURL https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL

  2. Yes, that could be the cause. Unfortunately, I can only maintain the current version. Please feel free to look into this and create a PR though.

@top-rated
Copy link
Author

top-rated commented Nov 4, 2024 via email

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

No branches or pull requests

2 participants