panotools: nona save uncropped images - image-processing

How do I save the uncropped images from nona as single images to further process them with other tools?
The other tools can't read cropped TIFFs so I need to save them as uncropped images spanning the whole FOV covered by all images.

Related

Converting Image in OpenCV to same color space as Photoshop

I am trying to de-noise a .tif image using OpenCV's bilateralFilter() method which is working.
However when I use cv.imwrite() to save the image, it is being saved in the BGR color format from openCV.
I want to save the image in the same color space as Adobe Photoshop.
I have attached the same image saved in photoshop and also the image saved from opencv for comparison.
OpenCV Image and Photoshop Image Comparison
The color between the two is very different in comparison. How can I save the file after the openCV changes to look like a typical .tiff file being opened in photoshop.
Any Help Is Appreciated!
I tried to convert the OpenCV image to RGB after I performed the bilateralFilter, but the openCV RGB is also different from what I see from opening the original image in Adobe Photoshop.

Can you swap out a tile in a tiled TIFF without reading the whole image into memory?

I have a very large 1.2GB medical image that I would like to add annotations to. I have a tiled TIFF and I know the tile I would like to replace with a new equally sized tile/image, could I do so without reading the entire TIFF into memory and then re-writing the entire 1.2GB file to make such a small change?
In other words, can you swap out a portion of the TIFF without reading and writing the entire image each time?

How to get the PDF from the Cytoscape graph without blurring the image?

I'm able to get the JPG and PNG images from the Cytoscape graph, but when converting them into PDF using jsPDF, the image shrinks and is blurry on zoom-in.
Is there a way the image or graph can be converted to PDF without blurring?
It seems to me like you need to learn the difference between bitmap formats and vector formats.
Bitmap formats like PNG, GIF, BMP and JPEG do not support limitless zooming because they are made of small squares, called pixels.
Vector formats like PDF, SVG and EPS support limitless zooming without blurriness because they are made of geometrical shapes (though PDF can include bitmaps).
So you can convert between bitmap formats without problems (though you may get compression artifacts when using JPEG) but you cannot directly go from vector to bitmap and vice versa.
If you convert a vector image to bitmap, you need to rasterize it to a specific resolution.
If you convert a bitmap image to a vector image, you could use some advanced algorithms to guess the shape behind the pixels, but there is almost never enough information for this to work perfectly.
If you convert a bitmap image to PDF, the tool you are using may just embed the bitmap in the PDF. Now the PDF editor may let you zoom, but the image will get blurry.
The only way to get a real vector PDF is by having the application, in this case Cytoscape, export PDF directly, not converting it afterwards.
You wrote Cytoscape cannot do this but I am reading the manual of version 3.7.0 and it says you can export directly to PDF using "File → Export as Image..." and then selecting "PDF". Maybe at the time you posted this question, this version wasn't released yet.
P.S.: As noted by #ideogram you are using Cytoscape.js and not Cytoscape, so you can use the cytoscape-svg NPM package to export as SVG, which is a vector format, which you can then convert to PDF without getting any blurriness.

GPUImage Large PNG Files

I can capture a still image on an iPad Retina Display with GPUImage using the crop filter (to 8x10 ratio with a size of 2420x1936 pixels = 4.68 megabytes) using capturePhotoAsPNGProcessedUpToFilter. The resulting PNG is 10mb, almost double the size of what an uncompressed image would be.
Is there a setting I am missing for PNG processing? Is there another way to reduce the size of the PNG file during capture?
A file this large really slows down things downstream.
Thanks for any advice or help!

resize image without losing quality with Gimp

i have a bunch of images which are way too big i need to decrease their size from 30 kb to 10 or 5 kb without loosing quality. I tried to change the dpi and pixels with no succeed. The images got blurred, and as they have text i can't read anything after the changes. Is there anyway i can accomplish this without loosing quality? I have almost a dozen images in my application.
Thanks in advance and have a nice day.
for batch resizing I use IrfanView (despite it's "lite-ness" it's very powerful).
It has a nice batch dialog, with a lot of options.
If you're working with png files try using better compression, and/or different color depth settings (if you're not using transparency you could try converting them to jpeg, although you might lose some quality)
changing color depth/range/compression might not affect image quality (not visibile anyway, if used with moderation) and it will decrease the size of the picture - in most of the cases anyway
if you want to stick to Gimp (I never personally used it), it should have some export features where you can select some settings for the image, like format and options
You cannot leave out data without reducing quality. Data has meaning.
You may try to use improved compression, pngcrush is the tool that automatically tries several approaches for you and picks the best.
Reducing colour depth will reduce the file size (while reducing colour quality). You can also turn on dithering in some image editors, but that's another loss in quality.
If your image has photographic content rather than graphical, convert to JPEG and use the JPEG quality settings, experiment with them a bit.
It seems that if I have a large png of 2500px wide and I want to resize it down to 100px wide, If I scale the image all at once the the desired size the image becomes way to distorted to use.
However If I scale the image in small increments of 200 pixels and repeat until you reach the desired length the image does not get as distorted. So if Im at 2500px then I would scale the image to 2300px then to 2100 and so on. The smaller the scale the less distortion.
Any resize method will have some loss, no matter how small. Following steps will make you lose quality.
steps for a single layer
layer->scale layer
image->scale image
image->fit canvas to layer
file->export as
steps for multiple layers
layer->new layer group
move all layers to layer group
select layer group
layer->scale layer
image->scale image
image->fit canvas to layer
file->export as

Resources