image-compression

Besides standard/progressive, the 3rd kind of JPEG compression: load by channel?

一曲冷凌霜 提交于 2019-12-31 10:44:25
问题 this question might be an "Open Question" and many of you might be eager to close it, but please don't. Let me explain. As we all know, JPEG has two kinds of compression (at least in Photoshop save dialog) optimized, where image was loaded kinda like line-by-line progressive, where image was loaded first mosaic-like, the progressively better till the original resolution I have read a lot of PNG/JPEG optimization articles before, but now I encountered this awesome third kind compression, from

Using Huffman coding to compress images taken by the iPhone camera

爱⌒轻易说出口 提交于 2019-12-31 03:47:22
问题 Im thinking to use the Huffman coding to make an app that takes pictures right from the iPhone camera and compress it. Would it be possible for the hardware to handle the complex computation and building the tree ? In other words, is it doable? Thank you 回答1: If you mean the image files (like jpg, png, etc), then you should know that they are already compressed with algorithms specific to images. The resulting files would not huffman compress much, if at all. If you mean that you are going to

Calling imageWithData:UIImageJPEGRepresentation() multiple times only compresses image the first time

不羁岁月 提交于 2019-12-30 05:26:25
问题 In order to prevent lagging in my app, I'm trying to compress images larger than 1 MB (mostly for pics taken from iphone's normal camera. UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; NSData *imageSize = UIImageJPEGRepresentation(image, 1); NSLog(@"original size %u", [imageSize length]); UIImage *image2 = [UIImage imageWithData:UIImageJPEGRepresentation(image, 0)]; NSData *newImageSize = UIImageJPEGRepresentation(image2, 1); NSLog(@"new size %u", [newImageSize

Out of Memory using bsxfun MATLAB

人盡茶涼 提交于 2019-12-25 03:44:46
问题 I try to implement image compression using Burrows-Wheeler transform. Consider an 1D matrix from path scanning is: p = [2 5 4 2 3 1 5]; and then apply the Burrows-Wheeler transform : function output = bwtenc(p) n = numel(p); x = zeros(length(p),1); for i = 1:length(p) left_cyclic = mod(bsxfun(@plus, 1:n, (0:n-1).')-1, n) + 1; x = p(left_cyclic); end [lex ind] = sortrows(x); output = lex(:,end); output = uint8(output(:)'); end And it works! But the problem is when i try to implement 1D matrix

Lossy compression of numpy array (image, uint8) in memory

泄露秘密 提交于 2019-12-24 21:53:17
问题 I am trying to load a data set of 1.000.000 images into memory. As standard numpy arrays (uint8) all images combined fill around 100 GB of RAM, but I need to get this down to < 50 GB while still being able to quickly read the images back into numpy (that's the whole point of keeping everything in memory). Lossless compression like blosc only reduces file size by around 10%, so I went to JPEG compression. Minimum example: import io from PIL import Image numpy_array = (255 * np.random.rand(256,

How do I compress an image with Run-Length Encoding using C#?

断了今生、忘了曾经 提交于 2019-12-24 18:17:46
问题 How do I compress an image with Run-Length Encoding using C#? Are there any available libraries to support this? Does Run-Length Encoding only work on bitmapped images? If so, How will I convert image types to bitmap using C#? I'd also like to ask what's their resulting file type after this, will they retain their file type or will they have a new one? 回答1: I know this is an old question, but it is one of the few things that comes up for RLE compression in C# on Google search. For someone

Client-Side v/s Server-Side image compression [closed]

雨燕双飞 提交于 2019-12-24 00:45:49
问题 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 3 years ago . I am working on something where users can upload pictures(size of image is not limited). Now I have two options either compressing the image using PHP(Server side) or compressing the image on client's machine using JavaScript and then uploading it to the server. I wanted to ask which approach out of the two

upload image in base64 format and compressed image before sending to server with retrofit?

青春壹個敷衍的年華 提交于 2019-12-23 05:05:29
问题 I've make upload image with retrofit that i follow from tutorial in internet. here are my code: AcademicClient.class @Multipart @POST("/") Call<ResponseBody> postImage(@Part MultipartBody.Part image, @Part("name")RequestBody name); MainFeed.class File file = new File(filePath); RequestBody reqFile = RequestBody.create(MediaType.parse("image/*"),file); MultipartBody.Part body = MultipartBody.Part.createFormData("upload",file.getName(),reqFile); RequestBody name = RequestBody.create(MediaType

How to apply orthogonal polynomial transformation on an image for image compression?

烂漫一生 提交于 2019-12-20 06:17:33
问题 I am working on Image compression based on orthogonal polynomial transformation. My input image is gray scale image of size 256*256. i divide this image into 4 by 4 blocks. and than apply the orthogonal polynomial operator on each block. but I am not getting correct coefficient. Example: If I have a block 4x4 of Input image: I=[5 11 8 10;9 8 4 12; 1 10 11 4;19 6 15 7]; and my polynomial operator for n=4 is: [M] = [p0 p1 p2 p3]=[1 -3 1 -3;1 -1 -1 9;1 1 -1 -9;1 3 1 3] After finding the outer

Best format for lossless image compression in C#

偶尔善良 提交于 2019-12-20 03:14:45
问题 I need to save video frames individually and compress them losslessly. I'm looking for the best method and format in c# - by best I mean the best balance of simplicity of implementation, good compression and reasonable processing requirements. I know PNG is lossless, but its compression isn't great for photo style images. I understand that there is a lossless Jpeg format, but is this implemented in C#? Are there other options I am unaware of? 回答1: Here are some compression ratio's for