Comments (4)
The Ionic API uses imagemagick at lower quality settings. The images produced by sharp are actually much better, because as you pointed out the PNG quality defaults to 100
. I think it'd be a great idea to pass in PNG options in the programmatic API. Maybe also a --quality
parameter, which is likely going to be the most used option.
from capacitor-assets.
Yes, the images produced by cordova-res
are definitely noticeably less fuzzy than those produced by the Ionic API. I got a preliminary version working last night (programmatic API only -- I forgot about the CLI, whoops) but passing in different values for quality
didn't actually seem to change anything; the output files were identical.
Setting the adaptiveFiltering
option to true
brought the size down a tiny bit, so it seemed to be passing the options in successfully, it just wasn't having the effect I thought it would...
Still trying to figure out what's going on ... π€
from capacitor-assets.
I figured out that the problem was obvious: the default libvips
that sharp
uses doesn't come with libimagequant
enabled. I was able to get it to build with libimagequant
on Linux, but not on Windows, which is where I do most of my development. With the libimagequant
-including libvips
installed, my changes worked fine in the Linux version. But I still can't get it to build properly in Windows. None of the Windows builds for libvips
include libimagequant
in the configuration, and although I can build libimagequant
on its own under Windows, I haven't yet been able to build libvips
with libimagequant
support.
from capacitor-assets.
@chorpler It's slightly concerning that Ionic devs might need to compile their own libraries just to get reasonably sized images on Windows. This utility is becoming the default in CLI 5.0.0 as you may know. I was looking over the issues on the sharp repo for this and it sounds like there isn't a good solution. Will Windows builds for libvips
include libimagequant
any time soon?
I made a separate issue for the quality option BTW: #13
from capacitor-assets.
Related Issues (20)
- Light mode icons are being overwritten with Dark mode icons
- Issue with "sharp" installation HOT 2
- Upgrade `@capacitor/cli` to fix `xml2js` `CVE-2023-0842` vulnerability HOT 1
- npm install error --iOS ( IONIC/ANGULAR Project )
- Source directory option name HOT 2
- Android splash screen looks distorted on Samsung S9 HOT 3
- 3.0.0: Cannot upload iOS app due to failed asset validation HOT 4
- "Unable to parse color from string" HOT 3
- Android Oreo (API 2) doesn't show proper Splash Screen HOT 1
- Feature request: Specify output folder for PWA HOT 1
- Chrome reports warnings with generated PWA icons
- sharp vulnerability in libwebp dependency HOT 2
- PNPM installation failed, cause by sharp v0.32.5 post install script HOT 1
- Suggestion: generate banner images HOT 2
- cannot install @capacitor/assets HOT 1
- Notifications support?
- bug: iOS icons/splash are created twice and overwritten by a bigger one
- Security advice semver HOT 1
- CanΒ΄t generate assets by using angular HOT 1
- Can we programatically run @capacitor/assets to generate and copy all the app/splash icons to ios/android folders
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capacitor-assets.