Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-22 Thread Jim Graham
(re-sending ... when I sent this before, the list was down due to having exceeded its maximum number of recipients ... something I've never heard of any e-mail list doing...and I've been around Listservs and other list varieties for decades) On Wed, Apr 18, 2012 at 03:20:31PM -0700, Massycat w

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-22 Thread Massycat
> > Perhaps there's some method of processing the photo and filter bitmaps in > chunks in a way I'm not aware of? Something that doesn't eventually end > up right back at an eventual out of memory error? Or some other method? > Have a look at BitmapRegionDecoder

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-20 Thread Jim Graham
On Fri, Apr 20, 2012 at 06:27:18AM -0700, Streets Of Boston wrote: > Note that createScaledBitmap may return the same bitmap as the input... > when the input parameters *width *and *height *are the same as the > width/height of your input bitmap: > > Change the code as follows (bold part is the

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-20 Thread Streets Of Boston
Note that createScaledBitmap may return the same bitmap as the input... when the input parameters *width *and *height *are the same as the width/height of your input bitmap: Change the code as follows (bold part is the changed part): Bitmap bmp1 = Bitmap.createScaledBitmap(src, width, height, f

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-19 Thread Jim Graham
On Thu, Apr 19, 2012 at 03:22:39PM -0700, Streets Of Boston wrote: > " *But there is one big question...why does recycling the bitmaps after > their last use still result in a force close, saying that I tried to use > them AFTER they were recycled? *" > > We don't have enough of your code. But s

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-19 Thread Streets Of Boston
" *But there is one big question...why does recycling the bitmaps after their last use still result in a force close, saying that I tried to use them AFTER they were recycled? *" We don't have enough of your code. But suppose you have this code executed: Bitmap bitmap1 = new BitmapFactory.deco

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-19 Thread JackN
it ok, youll get it. you just have some conceptual errors. On Wednesday, April 18, 2012 3:20:56 PM UTC-7, Spooky wrote: > On Wed, Apr 18, 2012 at 03:02:41PM -0700, JackN wrote: > > Depends on your depth. For 3 bytes per color (24 bit color), a 2592x1944 > > is 15 MEGABYTES. > > Again ... READ

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-19 Thread Jim Graham
On Thu, Apr 19, 2012 at 06:25:12AM -0700, Streets Of Boston wrote: > First, ignore this sentence below from my previous answer entirely: > "Save the byte[] data from the camera into file directly (this is your > JPG file)." > (It was a left-over chunk of my initial answer) Ah, that explains it.

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-19 Thread Streets Of Boston
First, ignore this sentence below from my previous answer entirely: "Save the byte[] data from the camera into file directly (this is your JPG file)." (It was a left-over chunk of my initial answer) The 'byte[] data' still takes up memory, because the caller (the Android SDK code that calls the

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-18 Thread Jim Graham
On Wed, Apr 18, 2012 at 03:59:23PM -0700, Streets Of Boston wrote: > Dealing with ARGB_ full-sized images may just not be possible for > certain devices (e.g. 5MPixel images taking 20Mbyte of memory, not leaving > much room for anything else). > Unless you can decode the byte[] data from the

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-18 Thread Streets Of Boston
Dealing with ARGB_ full-sized images may just not be possible for certain devices (e.g. 5MPixel images taking 20Mbyte of memory, not leaving much room for anything else). Unless you can decode the byte[] data from the Camera yourself... this would mean writing your own JPG decoder that woul

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-18 Thread Streets Of Boston
Dealing with ARGB_ full-sized images may just not be possible for certain devices (e.g. 5MPixel images taking 20Mbyte of memory, not leaving much room for anything else). Unless you can decode the byte[] data from the Camera yourself... this would mean writing your own JPG decoder that would

RE: [android-developers] need help working with very large (photo) bitmaps

2012-04-18 Thread Tommy Hartz
han X. -Original Message- From: android-developers@googlegroups.com [mailto:android-developers@googlegroups.com] On Behalf Of Jim Graham Sent: Wednesday, April 18, 2012 6:41 PM To: android-developers@googlegroups.com Subject: Re: [android-developers] need help working with very large (

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-18 Thread Jim Graham
On Wed, Apr 18, 2012 at 03:28:11PM -0700, Streets Of Boston wrote: > The size of the JPG/PNG file has almost nothing to do with the size of the > corresponding image in memory. Hopefully those who HAVE been saying that will read this. > An RGB_565 takes 2 bytes per pixel (5+6+5=16bits=2bytes).

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-18 Thread Kostya Vasilyev
On 04/19/2012 02:29 AM, Jim Graham wrote: [1] trying to find out if there's a way to process photo and filter bitmaps in chunks, and possibly save them in chunks, as well, or perhaps use some other method, to allow users to keep their maximum resolution, at 24-bit color, not lousy

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-18 Thread Jim Graham
On Thu, Apr 19, 2012 at 02:19:54AM +0400, Kostya Vasilyev wrote: > I'm not saying you dreamed those up, sorry, no offence meant. > > But since we seem to be discussing memory usage, not disk usage, the > compressed size is irrelevant. Thank you. My point exactly. > And 5 megapixels at RGB_

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-18 Thread Streets Of Boston
The size of the JPG/PNG file has almost nothing to do with the size of the corresponding image in memory. An RGB_565 takes 2 bytes per pixel (5+6+5=16bits=2bytes). An ARGB_ takes 4 bytes per pixel. This means a 5MPixel image will take 5M*2 = 10MByte in RAM when using RGB_565 or 5M*4=20MByte

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-18 Thread Jim Graham
On Wed, Apr 18, 2012 at 03:02:41PM -0700, JackN wrote: > Depends on your depth. For 3 bytes per color (24 bit color), a 2592x1944 > is 15 MEGABYTES. Again ... READ THE FOLLOWING (with corrected units): > > On Wed, Apr 18, 2012 at 12:50:41PM -0700, JackN wrote: > > > > > 350 kB jpg? in memory,

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-18 Thread Kostya Vasilyev
I'm not saying you dreamed those up, sorry, no offence meant. But since we seem to be discussing memory usage, not disk usage, the compressed size is irrelevant. And 5 megapixels at RGB_ is 32 bits per pixel or 20 megabytes in RAM, if stored as an uncompressed pixel array. -- K On 04/1

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-18 Thread Jim Graham
On Thu, Apr 19, 2012 at 01:55:18AM +0400, Kostya Vasilyev wrote: > On 04/19/2012 12:39 AM, Jim Graham wrote: > >I doubt that. I'm working with full-sized and near-full-sized images > >(3 MP//2048x1536 or 5 MP//2592x1944) and those are around 750 kB and 1.1 > >MB, respectively (give or take a few h

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-18 Thread JackN
Depends on your depth. For 3 bytes per color (24 bit color), a 2592x1944 is 15 MEGABYTES. jpeg aint rle On Wednesday, April 18, 2012 1:39:39 PM UTC-7, Spooky wrote: > On Wed, Apr 18, 2012 at 12:50:41PM -0700, JackN wrote: > > > 350 kB jpg? in memory, that could be huge. perhaps even 20 o

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-18 Thread Kostya Vasilyev
On 04/19/2012 12:39 AM, Jim Graham wrote: I doubt that. I'm working with full-sized and near-full-sized images (3 MP//2048x1536 or 5 MP//2592x1944) and those are around 750 kB and 1.1 MB, respectively (give or take a few hundred kB). I can't remember which I was working with at the time, but wh

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-18 Thread Jim Graham
On Wed, Apr 18, 2012 at 12:50:41PM -0700, JackN wrote: > 350 kB jpg? in memory, that could be huge. perhaps even 20 or more MB [corrected units in the above ... I've never actually SEEN anything that can store data in millibits, nor have I seen file sizes meansured in bits] I doubt that. I'm wo

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-18 Thread JackN
350 kb jpg? in memory, that could be huge. perhaps even 20 or more mbs On Wednesday, April 18, 2012 3:29:46 AM UTC-7, ANKUR1486 wrote: > > Even i am loading 350 kb image its giving out of memory . > I have image in drawable folder > and setting the image in java code .:( > > > > On Tue, Apr 17, 2

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-18 Thread ANKUR GOEL
Even i am loading 350 kb image its giving out of memory . I have image in drawable folder and setting the image in java code .:( On Tue, Apr 17, 2012 at 5:08 PM, Jim Graham wrote: > The question about blending methods resolved itself when I switched to > making the bitmaps for filters in the a

[android-developers] need help working with very large (photo) bitmaps

2012-04-17 Thread Jim Graham
The question about blending methods resolved itself when I switched to making the bitmaps for filters in the app. But one question still remains, and I need help with this one. When trying to blend the full-size camera image with an equal-size bitmap for the filter, unless I reduce the image size