New in Mass Image Compressor 3.0.0: It support raw formats of; camera, much better PNG file compression, improved image resizing algorithm, automatic updating image. To compress your pictures for sending in an e-mail message, under Compress for, click E-mail messages. Note: You can undo compression by clicking Undo Compress Picture on the Edit menu.
- Compress 1 0 3 – Image Compression Sleeves
- Compress 1 0 3 – Image Compression Size
- Compress Images Pdf
- Image Compression Tool
Compresses image as native plugin (Obj-C/Kotlin)
This library can works on Android and iOS.
- flutter_image_compress
- About common params
- format
- HEIF(Heic)
- format
- Result
- Troubleshooting or common error
- LICENSE
- About common params
Why don't you use dart to do it #
Q:Dart already has image compression libraries. Why use native?
A:For unknown reasons, image compression in Dart language is not efficient, even in release version. Using isolate does not solve the problem.
Usage #
Use as:
There are several ways to use the library api.
About common params #
minWidth and minHeight #
Compress 1 0 3 – Image Compression Sleeves
minWidth
and minHeight
are constraints on image scaling.For example, a 4000*2000 image,
minWidth
set to 1920, minHeight
set to 1080, the calculation is as follows:If your image width is smaller than minWidth or height samller than minHeight, scale will be 1, that is, the size will not change.
rotate #
If you need to rotate the picture, use this parameter.
autoCorrectionAngle #
This property only exists in the version after 0.5.0.
And for historical reasons, there may be conflicts with rotate attributes, which need to be self-corrected.
Modify rotate to 0 or autoCorrectionAngle to false.
quality #
Quality of target image.
If
format
is png, the param will be ignored in iOS.format #
Supports jpeg or png, default is jpeg.
The format class sign
enum CompressFormat
.Heif and webp Partially supported.
Webp
Support android by the system api (speed very nice).
And support iOS, but However, no system implementation, using third-party libraries used, it is not recommended due to encoding speed. In the future, libwebp by google (c / c ++) may be used to do coding work, bypassing other three-party libraries, but there is no guarantee of implementation time.
HEIF(Heic)
Heif for iOS
Only support iOS 11+.
Heif for Android
Use https://developer.android.com/reference/androidx/heifwriter/HeifWriter.html to implemation.
Only support API 28+.
And may require hardware encoder support, does not guarantee that all devices above API28 are available
inSampleSize #
The param is only support android.
For a description of this parameter, see the Android official website.
keepExif #
If this parameter is true, EXIF information is saved in the compressed result.
Attention should be paid to the following points:
- Default value is false.
- Even if set to true, the direction attribute is not included.
- Only support jpg format, PNG format does not support.
Result #
The result of returning a List collection will not have null, but will always be an empty array.
The returned file may be null. In addition, please decide for yourself whether the file exists.
About List<int>
and Uint8List
#
You may need to convert
List<int>
to Uint8List
to display images.To use
Uint8List
, you need import package to your code like this:Usage in
Image
Widget:Write to file usage:
Runtime Error #
Because of some support issues, all APIs will be compatible with format and system compatibility, and an exception (UnsupportError) may be thrown, so if you insist on using webp and heic formats, please catch the exception yourself and use it on unsupported devices jpeg compression.
Example:
Android #
You may need to update Kotlin to version
1.3.72
or higher.Compress 1 0 3 – Image Compression Size
iOS #
No problems currently found.
Troubleshooting or common error #
Compressing returns null
#
Sometimes, compressing will return null. You should check if you can read/write the file, and the parent folder of the target file must exist.
For example, use the path_provider plugin to access some application folders, and use a permission plugin to request permission to access SD cards on Android/iOS.
Android build error #
See flutter/flutter/issues#21473
You need to upgrade your Kotlin version to
1.2.71+
(recommended 1.3.72).If Flutter supports more platforms (Windows, Mac, Linux, etc) in the future and you use this library, propose an issue or PR!
About EXIF information #
Using this library, EXIF information will be removed by default.
EXIF information can be retained by setting keepExif to true, but not
direction
information.LICENSE #
The code under MIT style.
PNG/JPEG encoder #
Each using system API. Wifi signal: status monitor 4 2 2.
Webp encoder #
Use SDWebImageWebPCoder to encode the UIImage in iOS. (Under MIT)
Android code use the Android system api.
Compress Images Pdf
HEIF encoder #
Use iOS system api in iOS.
Use HeifWriter(androidx component by Google) to encode in androidP or higher.
About Exif handle code #
The iOS code was copied from dvkch/SYPictureMetadata, LICENSE
The android code was copied from flutter/plugin/image_picker and edit some. (BSD 3 style)
Description
Make your website faster by optimizing your JPEG and PNG images. This plugin automatically optimizes all your images by integrating with the popular image compression services TinyJPG and TinyPNG.
Features
Image Compression Tool
- Automatically optimize new images on upload.
- Advanced background optimization to speed up your workflow.
- Optimize individual images already in your media library.
- Easy bulk optimization of your existing media library.
- Automatically resize huge image uploads by setting a maximum width and/or height for more reasonable browser display.
- Display JPEG images more quickly with progressive JPEG encoding.
- Chose to preserve copyright metadata, creation date and GPS location in your original images.
- Supports compression of animated PNG.
- Select which thumbnail sizes of an image may be optimized.
- Multisite support with a single API key.
- WPML compatible.
- WooCommerce compatible (see below).
- WP Retina 2x compatible.
- WP Offload S3 compatible.
- See your usage on the settings page and during bulk optimization.
- Color profiles are automatically translated to standard RGB color.
- Convert CMYK to RGB to save more space and add compatibility.
- Dashboard widget with your total savings.
- Optimize and resize uploads with the WordPress mobile app.
- No file size limits.
How does it work?
After you upload an image to your WordPress site, each resized image is uploaded to the TinyJPG or TinyPNG service. Your image is analyzed to apply the best possible optimization. Based on the content of your image an optimal strategy is chosen. The result is sent back to your WordPress site and will replace the original image with one smaller in size. On average JPEG images are compressed by 40-60% and PNG images by 50-80% without visible loss in quality. Your website will load faster for your visitors, and you’ll save storage space and bandwidth!
Getting started
Install this plugin and follow the instructions to set up your account. With a regular WordPress installation you can optimize roughly 100 images each month for free. The exact total depends on the number of thumbnail sizes that are in use in your WordPress installation. You can change which of the generated thumbnail sizes should be optimized on the Settings > Compress JPEG & PNG images page. Once installed you can also switch to a paid account which removes the limits and allows you to optimize as many images as you like.
Optimizing all your images
You can bulk optimize your existing JPEG and PNG images all at once by going to Media > Bulk Optimization. Clicking on the big button will start optimizing all unoptimized images in your media library.
Multisite support
The plugin is fully multisite compatible and you can set the API key for all sites by defining the key in your wp-config.php file. View the installation instructions for more information.
WooCommerce compatibility
This plugin is fully compatible with WooCommerce. However, we have discovered that WooCommerce may be trying to regenerate image attachment metadata over and over again on each page visit. If you are using WooCommerce please follow the tips from the support section. This may make your WooCommerce shop even faster than it was before.
Contact us
Got questions or feedback? Let us know! Contact us at [email protected] or find us on Twitter @tinypng.
Contributors
Want to contribute? Check out the Tinify WordPress plugin on GitHub.
Installation
From your WordPress dashboard
- Visit Plugins > Add New.
- Search for ‘tinypng’ and press the ‘Install Now’ button for the plugin named ‘Compress JPEG & PNG images’ by ‘TinyPNG’.
- Activate the plugin from your Plugins page.
- Go to the Settings > Compress JPEG & PNG images page and register a new account.
- Or enter the API key you got from https://tinypng.com/developers.
- Go to Media > Bulk Optimization and optimize all your images!
From WordPress.org
- Download the plugin named ‘Compress JPEG & PNG images’ by ‘TinyPNG’.
- Upload the
tiny-compress-images
directory to your/wp-content/plugins/
directory, using your favorite method (ftp, sftp, scp, etc…) - Activate the plugin from your Plugins page.
- Go to the Settings > Compress JPEG & PNG images page and register a new account.
- Or enter the API key you got from https://tinypng.com/developers.
- Go to Media > Bulk Optimization and optimize all your images!
Optional configuration
The API key can also be configured in your wp-config.php file. To do this you can add the following PHP code that sets the API key.
Once set up you will see a message on the Settings > Compress JPEG & PNG images page. This will work for normal and multisite WordPress installations.
FAQ
Q: How many images can I optimize for free?
A: In a default WordPress installation you can optimize around 100 images for free each month. WordPress creates different thumbnails of your images which all have to be compressed. Some plugins even add more sizes, so take a look at the Settings > Compress JPEG & PNG images page before you start optimization.
Q: How can I remove the 500 limit?
A: Just add your Payment details on your account dashboard to remove the limit. For a small fee the additional compressions above 500 will then be charged to your account at the end of each month.
Q: What happens to the optimized images when I uninstall the plugin?
A: When you remove the plugin all your optimized images will remain optimized.
Q: I don’t recall uploading 500 photos this month but my limit is already reached. How is this number calculated?
A: When you upload an image to your website, WordPress will create different sized versions of it (see Settings > Compress JPEG & PNG images). The plugin will compress each of these sizes, so when you have 100 images and 5 different sizes you will do 500 compressions.
Q: Is there a file size limit?
A: No. There are no limitations on the size of the images you want to compress.
Q: Can I use the same API key on all my websites?
A: Yes, there are no limitations. You can add the same key everywhere.
Q: Can I hide my API key from the admin?
A: Yes, you can hide your API key from the admin so other admin users will not be able to see it. To do this you should define the API key in your wp-config.php file. See the installation instructions for more information.
Q: What happens when I reach my monthly limit?
A: Everything will keep on working, but newly uploaded images will not be optimized. Of course we encourage everyone to switch to a paid account to cover the hosting and development costs of the service.
Q: Can I optimize all existing images in my media library?
A: Yes! After installing the plugin, go to Media > Bulk Optimization, and click on the start button to optimize all unoptimized images in your media library.
Q: How do I switch to a paid account?
A: You can upgrade to a paid account by adding your Payment details on your account dashboard. Additional compressions above 500 will then be charged at the end of each month as a one-time fee.
Reviews
Sent for the API key which didn't arrive and no option to have it sent again adding to that the support on here won't let you make any new topics its become too much of a pain to get working.Pitty because the website is great.