Re: Why is this code not cleaning up int arrays? or How to detect an image is a solid color?



Thanks for the suggestion RGB, but I know because of the images I'm
working with there are only about 7-8 possible solid color images.

Anyway, I first tried moved the declaration of the int array up,
hoping that would force the system to reuse teh same memory area each
time through the loop, but that didn't make a difference.

Then I made two other changes, and I'm not sure which was the actual
fix. I explicitly called System.gc() every 100th time through the
loop. Secondly I made a more fundamental change to the algorithm. I
switched from getting the BufferedImage's int array to repeatedly
using the BufferedImage's getRGB(x,y) method to get a single pixel of
info. When I wrote this before, I don't know if that method couldn't
be used for some reason (different image type for example) or if I
thought accessing the int array would be faster, or I just didn't know
about the method. Anyway, I didn't test these separately, so I don't
know which one made a difference, but I did want to post a follow up
for anyone interested or for future reference.
.



Relevant Pages

  • Re: OT Camera Raw 5.2 and Photoshop CS4, not CS3
    ... used at the loop boundaries. ... will lay out an array in memory. ... But if the the compiler sets the array in memory as 8 blocks of 6 reals, ... Instead it can be quite slow on large images. ...
    (rec.photo.digital.slr-systems)
  • Re: Why is this code not cleaning up int arrays? or How to detect an image is a solid color?
    ... loop. ... Secondly I made a more fundamental change to the algorithm. ... thought accessing the int array would be faster, ...
    (comp.lang.java.programmer)
  • Re: Loop Problem (At Least I think)
    ... If there are no images matching the product ... "" Then" statement (the one below the loop, outside of it), is this just ... >> script to finish. ... > 2) Read the database table and acess the dictionary object for the ...
    (microsoft.public.scripting.vbscript)
  • Re: checking for a file
    ... need to break out of the loop early. ... The images are gathered from a web cam, ... So, in my javascript loop before i try to load a slide image, i wanted ... the image is missing. ...
    (alt.html)
  • Re: Compiled batch file wont execute properly
    ... The file is designed to rotate jpeg images using the program exifiron. ... the batch file will process an unlimited number of images at one ... have you tried shifting in a loop? ... goto:loop ...
    (microsoft.public.win2000.cmdprompt.admin)