image-compression

android Fatal Exception: AsyncTask #5

浪尽此生 提交于 2019-12-12 03:44:10
问题 I'm having a problem with my asynctask code. here is my code. it said that it couldn't read row 0. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == PICK_IMAGE_REQUEST && resultCode == RESULT_OK && data != null && data.getData() != null) { Uri filePath = data.getData(); try { new ImageCompressionAsyncTask(getApplicationContext()).execute(String.valueOf(filePath)); } catch

How to reduce filesize of gradient PNG?

萝らか妹 提交于 2019-12-11 11:56:17
问题 I am trying to create a background image on a webpage, which is similar to the 404 page used on tumbler... http://testing404image.tumblr.com/ Here we can see a PNG which is 1623*1064 pixels, yet appears reasonably smooth gradient wise. The direct link for the image is http://testing404image.tumblr.com/images/status_bg.png?2 When I try to create a similar PNG (different colors, but same size) in Photoshop CS4 for Mac, the resulting file ends up at > 400k, whereas tumblers is 90k Ive tried

Opera Turbo and background-repeat doesn't work

痴心易碎 提交于 2019-12-11 07:06:28
问题 For example I have such a code: <style> body { background: url('back.png') repeat-y center; } </style> <body> </body> It works fine in all browsers, include Opera. Looks like this: But if Opera Turbo mode is turned on, than it looks like this: Why is this, and can it be fixed? P.S. Opera 11.10 on Ubuntu 10.10 回答1: To find why your images sometimes look like a mess in Opera Turbo, you should learn how Opera Turbo works (actually, what is Turbo mode). As you know, Opera Turbo comes very handy

Compress a Byte Array Image without Scaling using .Net C#

旧街凉风 提交于 2019-12-11 04:43:36
问题 I'm building an AngularJS Application, for Service I'm using .NET C# for coding purpose. I'm retrieving Images from SQL Server as Byte Array and I'm sending the Byte Array to AngularJS and it displays the Image in the HTML. I followed the same as like in the post Load image from C# Byte array and place image in html tag using AngularJS But I'm facing the performance issue in my data. My database contains the byte array size is approx. 2 to 3 MB. So, based on Internet Bandwidth its struggling

AttributeError: 'NoneType' object has no attribute 'ravel'

核能气质少年 提交于 2019-12-10 23:58:45
问题 Can someone please tell me what is wrong with this code? I keep on getting a NoneType error. I am trying to create a histogram. import cv2 import numpy as np from matplotlib import pyplot as plt img = cv2.imread('C:\Pictures\naturalScene.bmp',0) plt.hist(img.ravel(),256,[0,256]); plt.show() 回答1: From the docs: The function imread loads an image from the specified file and returns it. If the image cannot be read (because of missing file, improper permissions, unsupported or invalid format),

Resizing pictures while still preserving quality in android

不想你离开。 提交于 2019-12-10 18:38:12
问题 I want to reduce the image file size below 100 KB while preserving the image quality like whatsapp and facebook did. I tried almost all the code of android image compression available on stackoverflow but that doesn't work for me. Right now i am following this blog to reduce the image size, and i am getting the image below 100 KB but image quality is poor. Is there any way that i can reduce image size below 100 KB while preserving the quality??? (Original Image size can vary from 20 KB to 8

Optimize uploaded images with php (jpeg)

十年热恋 提交于 2019-12-08 22:46:06
问题 When running Page Speed in Google Chrome it suggests to optimize/compress the images. These images are mostly uploaded by users, so I would need to optimize them during uploading. What I find about optimizing jpeg images with php is something like using the following GD functions: getimagesize() imagecreatefromjpeg() imagejpeg() Since I am resizing the images after upload I'm already pulling the image through these functions and in addition I use imagecopyresampled() after imagecreatefromjpeg

How to convert .tiff/.bmp to JPEG-XR with Imagemagick's convert tool?

泪湿孤枕 提交于 2019-12-07 13:20:00
问题 i'm using the convert tool from imagemagick to convert images to the jpeg-xr format. i'm using the latest version under debian linux (ImageMagick-6.8.6-8). The problem is convert -format jxr or convert -format wdp produce the same format as my source image and no valid jpeg-xr file. Is my -format parameter wrong? i didn't find anything about it thanks in advance 回答1: The -format option is for outputting metadata in a specific format, not selecting the output file format. Selecting a specific

Optimize images - Losslessly compress images in Java

空扰寡人 提交于 2019-12-07 12:11:41
问题 Having an ecommerce website, We have thousands of product images. On checking pagespeed on google it shows me something like this: I was wondering, if there is any built in feature in Java or any third party library is available with which we can losslessly compress all the images that we host. Hence we can save few KBs of our customers. On searching through internet I found few like punnypng and kraken which are paid, hence we do not have heavy image uploaded every month, subscribing to them

How to rotate a JPEG file on Android without losing quality and gaining file size?

安稳与你 提交于 2019-12-07 02:13:38
问题 Background I need to rotate images taken by the camera so that they will always have a normal orientation. for this, I use the next code (used this post to get the image orientation) //<= get the angle of the image , and decode the image from the file final Matrix matrix = new Matrix(); //<= prepare the matrix based on the EXIF data (based on https://gist.github.com/9re/1990019 ) final Bitmap rotatedBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(),matrix,false)