image-compression

Compress Image in android

怎甘沉沦 提交于 2019-11-29 03:29:31
问题 I am making an application which takes image from the camera and then email it. Friends since you know that images from camera may be of too much resolution and in size as well e.g. 2.0MB and more so what i want is to re-size the image in size as well as in resolution so that i could attach that file to the email. So can anybody give me some code sample or some guidelines to get over my problem. Thanks in advance 回答1: you can do this to compress BitMap.. mBitmap = Bitmap.createScaledBitmap

Image Compression tools via command line [closed]

Deadly 提交于 2019-11-28 13:48:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I'm searching best tool to compress images (png and jpeg) via command line. After googling I found trimage which is good as it compresses both png and jepeg, but compression ratio is very poor in this case. I came across jpeg-optimizer.com online tool which does the job way better than trimage. Can any one help

PNG Compression in .net

99封情书 提交于 2019-11-28 12:47:47
I want to compress bitmaps to PNG with different compression levels as these levels are available in JPEG compression in C#. I have 20 to 30 images of different sizes to process in 1 sec. Is there any library to achieve this compression in PNG with different compression levels? A lossless compression method does not have to be single quality level. I mean, some lossless compression methods have some parameters to choose speed/compression ratio trade-off. It's up to author. As to PNG compression, it's actually bunch of filters and deflate algorithm. Considering deflate has a redundant encoding

Reduce the size of a bitmap to a specified size in Android

*爱你&永不变心* 提交于 2019-11-28 09:56:05
I want to reduce the size of a bitmap to 200kb exactly. I get an image from the sdcard, compress it and save it to the sdcard again with a different name into a different directory. Compression works fine (3 mb like image is compressed to around 100 kb). I wrote the following lines of codes for this: String imagefile ="/sdcard/DCIM/100ANDRO/DSC_0530.jpg"; Bitmap bm = ShrinkBitmap(imagefile, 300, 300); //this method compresses the image and saves into a location in sdcard Bitmap ShrinkBitmap(String file, int width, int height){ BitmapFactory.Options bmpFactoryOptions = new BitmapFactory.Options

TIFF plot generation and compression: R vs. GIMP vs. IrfanView vs. Photoshop file sizes

为君一笑 提交于 2019-11-28 03:45:10
问题 I generated some high resolution publication quality plots for example library(plot3D) Volcano<-volcano zf=10 #zoom factor tiff("Volcano.tif", width=1800*zf, height=900*zf, res=175*zf, compression="lzw") image2D(z = Volcano, clab = "height, m",colkey = list(dist = -0.20, shift = 0.15,side = 3, length = 0.5, width = 0.5,cex.clab = 1.2, col.clab = "white", line.clab = 2,col.axis = "white", col.ticks = "white", cex.axis = 0.8)) dev.off() the file is 22 MB. Now I open the file with GIMP and

How can I compress images using java?

感情迁移 提交于 2019-11-28 00:26:47
问题 From pagespeed I am getting only image link and possible optimizations in bytes & percentage like, Compressing and resizing https://example.com/…ts/xyz.jpg?036861 could save 212KiB (51% reduction). Compressing https://example.com/…xyz.png?303584508 could save 4.4KiB (21% reduction). For an example I have image of size 300kb and for this image pagespeed is displaying 100kb & 30% of reduction. This is only for one image but I am sure I will have lots of images for compression. so how can I

How to compress Bitmap as JPEG with least quality loss on Android?

我怕爱的太早我们不能终老 提交于 2019-11-27 19:28:30
This is not a straightforward problem, please read through! I want to manipulate a JPEG file and save it again as JPEG. The problem is that even without manipulation there's significant (visible) quality loss. Question : what option or API am I missing to be able to re-compress JPEG without quality loss (I know it's not exactly possible, but I think what I describe below is not an acceptable level of artifacts, especially with quality=100). Control I load it as a Bitmap from the file: BitmapFactory.Options options = new BitmapFactory.Options(); // explicitly state everything so the

Is it possible to tell the quality level of a JPEG?

我只是一个虾纸丫 提交于 2019-11-27 17:29:36
This is really a two part question, since I don't fully understand how these things work just yet: My situation: I'm writing a web app which lets the user upload an image. My app then resizes to something displayable (eg: 640x480-ish) and saves the file for use later. My questions: Given an arbitrary JPEG file, is it possible to tell what the quality level is, so that I can use that same quality when saving the resized image? Does this even matter?? Should I be saving all the images at a decent level (eg: 75-80), regardless of the original quality? I'm not so sure about this because, as I

PNG Compression in .net

六月ゝ 毕业季﹏ 提交于 2019-11-27 07:22:46
问题 I want to compress bitmaps to PNG with different compression levels as these levels are available in JPEG compression in C#. I have 20 to 30 images of different sizes to process in 1 sec. Is there any library to achieve this compression in PNG with different compression levels? 回答1: A lossless compression method does not have to be single quality level. I mean, some lossless compression methods have some parameters to choose speed/compression ratio trade-off. It's up to author. As to PNG

Reduce the size of a bitmap to a specified size in Android

醉酒当歌 提交于 2019-11-27 03:14:18
问题 I want to reduce the size of a bitmap to 200kb exactly. I get an image from the sdcard, compress it and save it to the sdcard again with a different name into a different directory. Compression works fine (3 mb like image is compressed to around 100 kb). I wrote the following lines of codes for this: String imagefile ="/sdcard/DCIM/100ANDRO/DSC_0530.jpg"; Bitmap bm = ShrinkBitmap(imagefile, 300, 300); //this method compresses the image and saves into a location in sdcard Bitmap ShrinkBitmap