Ad
Timber\Image: Is It Possible To Flatten A Transparent PNG Onto A Specific Hex Color?
I would like to convert a transparent PNG to JPG and specify a background color for the transparent areas, without having to specify a dimension.
Essentially, what I'm looking for is a combination of Timber\Image
's tojpg and letterbox filters, minus letterbox
's width and height requirements.
Ad
Answer
@hailseitan: try grabbing the current dimensions of the image via the width()
and height()
methods and then feeding them into letterbox
!
Ad
source: stackoverflow.com
Related Questions
- → CORS missmatch because of http
- → Building sitemap for 2 wordpress install under 1 domain
- → How to remove empty elements after class?(jQuery)
- → Get width of an element and apply to another relative to the first one?
- → How to remove caption p class from wordpress?
- → 301 Redirection from no-www to www in wordpress
- → Laravel 5 routing using prefix
- → WordPress - Header position Top, Left &Right
- → how to add rel=nofollow to some specific external links in wordpress
- → octobercms install error: database is not empty?
- → How to edit the index page of wordpress theme?
- → How to select a Post Type (Wordpress) to pass a filter in head?
- → What sort of URL structure should be used to display AMP HTML vs vanilla HTML
Ad