Login  Register

Re: PNG issue

Posted by Rainer M. Engel on Sep 03, 2013; 8:24am
URL: http://imagej.273.s1.nabble.com/PNG-issue-tp5004564p5004629.html

Wayne told me that more recent versions of JAVA (i.e. 1.6.0_43 or newer
1.7. i.e.) do not create that error.

If there happens something similar to you, there is a neat workaround,
since opening every image with BIO-Format (it would work!) is much
slower. In Windowless-Mode in my tests 25x slower.

Here is a Macro to detect, when there is a opening-error with ImageJ's
default functions and only then BIO-Format is used. When working with
the log-window, it doesn't clutter there either.

//-------------------------------------------------------------------
for (i=0; i<list1.length; i++) {
        showProgress(i+1, list1.length);
        actSource = dir1+list1[i];

        snapLogA = getInfo("log");
        IJ.redirectErrorMessages();
        open(actSource);
        snapLogB = getInfo("log");
        if (snapLogA != snapLogB) {
                print("\\Clear");
                print(snapLogA);
                run("Bio-Formats (Windowless)", "open=&actSource");
        }
       
        //do processing ...

        run("Close All");
}

//-------------------------------------------------------------------

Maybe useful here and there..

Best regards,
Rainer


Am 29.08.2013 11:31, schrieb Rainer M. Engel:

> Am 27.08.2013 10:58, schrieb Rainer M. Engel:
>> Hello everyone,
>>
>> there seems to be a problem with the png-built-in-compression which is
>> good to have but not to deactivate, at least I think.
>>
>> The attached macro creates n-Files in a certain resolution. It occurred
>> to me on different systems, that images containing only black and white
>> pixels (binary) will most likely have this problem. In my passes up to 3
>> Images out of 2000 will not reopen in ImageJ. That doesn't mean they are
>> overall corrupt since PS and other Tools can open them.
>>
>> What does the macro do?
>> 1 Step: it creates n-Images inside of a user defined working folder
>> 2 Step: these images are opened again
>>
>> There are two optional settings (rotation and blur). It seems to me, the
>> more grey pixels there are, the more likely all will be fine.
>>
>> What do you encounter?
>>
>> Best regards,
>> Rainer
>>
>>
>
>
> No one, nothing?
>
> I know a similar, maybe the same issue (by sharing libraries) with
> VirtualDub exporting to a png-image sequence. If the images are overall
> grayscale.
>
> As a note, if you run into the same issue like me, switch to BIO-Formats
> for opening those images with ImageJ/Fiji; no solution but a working
> procedure.
>
> Thank you.
> RME
>
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html