Loading image sequence wrong size expected found

imagej

#1

Dear all,

I would like to load an sequence of several jpeg-images (after this I would like to adjust brightness/contrast for all in one step). These images are scans I cutted before (first step of editing).

But when I would like to load the images into Fiji the log tells me: image XXX; wrong size; xxx expected, xxx found

I think the issue is the cutting of the images before this step.

I cannot delete the pixel-meta data (or: I don’t know how to do this for pixel-meta data)

What can I do to load my image as stack anyway? (I need to adjust brightness after cutting)

I am very thankful for every help!

Christoph


#2

Good day Christoph,

it would be helpful to know how you crop your images, i.e. which application you use. I’m pretty sure you didn’t do the cropping in ImageJ, why?

Usually, an application that is able to crop images specifies the new size as well …

Furthermore, it is advantageous to the image processing with the original none- or losslessly compressed images, i.e. in TIFF- or PNG-file format. JPEG should not be used for serious tasks.

How do you open your images in ImageJ?
Per drag and drop or per “Open”-command or per “Bioformats”?

Regards

Herbie


#3

Hi Herbie :wink:

thanks fpr your answer!

I crop the images with IrfanView because the shortcuts are useful and I like this program. And I like to use JPEG and it’s the format I aquire the scans/pictures. I use saving with 40% compressing because I don’t want to have so big pictures (finally I will have ca. 18.000 pictures, which should have place on one stick => I need to have a look on size).

Usually I open pictures by dropping the folder in Fiji and than I create a stack.

all the best

Christoph


#4

Christoph,

could you please provide an image for which you get the error message?

Regards

Herbie


#5

Hi Herbie,

I would like to upload bute there is an erroe message:

“Sorry, the image you are trying to upload is too large (maximum dimension is 40-megapixels), please resize it and try again.”

Can I give you a dropbox link?

all the best

Christoph


#6

Sure,

post the link to this forum!

Regards

Herbie


#7

so here is the link to two pictures I already cropped and adjustes the angle (but not the contrast):

(you are able to load the first, but from the second on you got the error messages like on the screenshot in my very first post)

all the best Christoph


#8

Christoph,

if both images are dragged to the ImageJ main window, they open without problem (plain ImageJ 1.51t, Java 1.6.0_65, macOS 10.11.6). Perhaps you need to spend more RAM-memory for ImageJ (Edit >> Options >> Memory & Threads…).

Another and more economic method to open the images is to drag the folder with the images to the ImageJ main window and check “Use Virtual Stack” in the appearing dialog.
Or use “File >> Import >> Image Sequence…”, select the folder with your images and check “Use Virtual Stack” in the appearing dialog.

Furthermore, your scans show a high spatial resolution (600dpi I guess) and the image content is in fact binary (the images are rastered and the raster is well resolved). Consequently, you could binarize the images according to a suitable threshold. This reduces the necessary disk-space. Binarization doesn’t help when opening images in ImageJ because ImageJ uses 8bit-depth for binary images.

HTH

Herbie


#9

Thanks for your help Herbie!

I don’t think thats a problem of the memory because a folder with unprocessed scans opens without an problem.

If I use virtual stack I got the problem that I cannot change contrast for all … but a virtual stack I can duplicate and than I can work with it like I initally wanted. This is quite a methode to open my stack.

Problem solved I think: But: after changing contrast and saving the pictures have a bigger size in memory. What can I do to prevent the rising memory space?

Yes I have 600 dpi because I digitalize papers with historical approach. I would like to do it as perfect as I can do. How can I binarize it and what does it mean?

All the best

Christoph


#10

Christoph,

I think that time has come for studying the ImageJ-manual:
https://imagej.nih.gov/ij/docs/guide/index.html

I don’t know in which format you are re-saving the images. In the first place ImageJ uses TIF but you can choose from a variety of other image file formats (File >> Save As).

Re-saving your images in JPG-format is sub-optimum because you introduce additional JPG-artifacts. This is only one of the reasons for doing image acquisition and processing using a lossless image file format.

600dpi for a news-paper scan with rastered images is sufficient. The news-paper printing process is binary (black & white, without gray values) and when scanned correctly, you won’t loose information if you scan binary or binarize a gray-valued scan (see the manual).

Regards

Herbie


#11

Thanks Herbie,

yes, you are right! I will do this! Sorry!

But now I got so many scans in JPEG and I need to re-save in the JPEG format. Do you know a possibility to keep the size (roughly)? Or at least don’t to grow them to much while re-saving?

All the best

Christoph


#12

Christoph,

the problem is that you try to achieve high quality but save several times as JPEG and this is contradictory.

Furthermore, you like to see several images stored as a stack which either requires a TIF-stack (ImageJ default without compression) or a movie format for which various compression methods exist.

I don’t think that image stacks are the right fornat for storing newspaper pages. The usual format for such text pages is PDF. Generally modern document scanners let you save the scans as PDFs.

If you need to make adjustments to scans, you could later save the images as PDFs. In any case, I’d not change the application for various adjustments, as you do now. ImageJ can rotate and crop images, so why not do all of the adjustments in ImageJ. There used to be a “Save to PDF”-plugin for ImageJ but I have no experience with it.

Alternatively use Photoshop which provides all options and saves images as PDF.

Of course, you need to combine the single page PDFs to create a multipage PDF (Acrobat Professional does this). I don’t know if there are freeware applications for this task.

Regards

Herbie


#13

I don’t want to save the pictures as stack, it’s only a way to change contrast for all in one step. I want to save them finally als JPEG. I hope they can be read in thirty years or later. With PDF I don’t think so.

I need to change the programm because there is so a huge number of scans I cannot handle in one step (I would like to cut and adjust angle in first step, in the second I would like to adjust contrast but only for one and than I would like to use the option stack).

Thanks for your help, I will find a way to compress them after changing contrast :wink:

All the best
Christoph


#14

As I’ve written ImageJ stacks are in TIF-format.

[…] JPEG. I hope they can be read in thirty years or later. With PDF I don’t think so.

PDF now is an ISO-standard and will remain.
https://en.wikipedia.org/wiki/Portable_Document_Format
https://www.iso.org/standard/63534.html

I need to change the programm because there is so a huge number of scans I cannot handle in one step (I would like to cut and adjust angle in first step, in the second I would like to adjust contrast but only for one and than I would like to use the option stack).

You can do all that in ImageJ.

Finally, did you consider binarizing the images?

Regards

Herbie


#15

binarizing is only possible for pictures with black/white, but there are many pictures with are in colour. I want to have all 18.000 pictures in the same look/format.

I cannot change the situation. There are still so many scans in JPEG, I have to work with it now.

All the best

Christoph


#16

dear @Christoph_Hentschel,
I don’t know if I have understood well the goal of this task you want to perform.
In my opinion, you cannot achieve it with the Image Sequence command since it requires the same dimension(width and height to put in a stack) for the images, but if you want to adjust brightness and contrast
I think you have two other options:

  1. programmatically: with a for loop that opens single image by single image all the images in your folder and applies a brightness and contrast change and saves it.
  2. opening a bunch of them together, open the brightness/contrast tool click on “Set” and then “propagate to all other open images” that way you will set the same display range to all of your open images but the you gave to click apply on all of them and save them one-by-one.

I think the 1st option could be the good one for you and save you time and it’s easy to script and write it.

I hope I’ve been helpful,
have a nice day
Emanuele Martini


#17

Thanks Emanuele!

programming is the best way in each case, I wish I could do it ;D

Unfortunately I belong to the the users with very low experience. But it is a good tip to open a bunch of pictures, adjust contrast and click on set! Very useful, but I have to save every single picture. This is becaus I would like to use the stack where I can do the same but I can save all picturres with original file name with two clicks.

Now I found an other way to adjust my pictures. I use an other programm (IrfanView with Batch-Processing). Fiji is a great tool but I realized, that for this purpose I need something other.

Thanks again! All the best

Christoph