I want to write a simple Java application to display a portion of large stitched tiles of TIFF images. I want to be able to zoom and move around.
Is using JAI the best current way to go? The documentation seems awfully out-of-date.
I found this sample program to display a TIFF image. But how can I zoom into a TIFF image? And is it possible to stitch multiple images and seemingly move into a portion, regardless of the image boundaries?
Related
I want to create a video from a series of images and add a transition between the images (e.g., fade in and fade out). I’m looking for a Java solution and not a C++ one (FFmpeg or anything else).
I checked out JCodec and MediaCodec, but none of those support image transitions.
Have you already tried it with OpenCV for Java? OpenCV offers almost everything you need for such a task. To the transitions you would have to worry about then manually with image blending. But that can be solved with OpenCV too. Just take a look at the documentary
EDIT:
It looks like the Java API lacks the appropriate module that can encode a sequence of images. You can fade images in any case. Take a look at the tutorial. This means you would have to crossfade the images with OpenCV and then use another API (e.g. jcodec) to make a video from the images you create.
I am working on a project where I have users uploading print quality high resolution tif images and I need to create a lower resolution web quality preview for the user if/when they come back to view what they uploaded.
Currently I have a working solution to resize these images using ImageIO.read and ImageIO.write but it is taking up to 15 minutes to modify and save these preview images. I am wondering if there is a better solution that would take less time to complete. Or is this a RAM issue that I am experiencing?
I'm not sure what libraries you're using, but you can do this in two passes. If you're cutting the resolution by half in width and height, then simply take every other pixel and create a quick image from that. It will be low quality, but you should be able to do this very quickly even on large images. Later, perhaps with a workflow automation system, you can "slow cook" a better-quality derez and take some time to do it well.
I have an image of rather large resolution (9332 x 5116). When I go to the codename one editor, to add image, I can add the image, but then when I get back into the editor, the left-side menu doesn't display properly. To be more specific, it doesn't redraw when I'm in the Multi-image or All Images menu. The only way to go back to normal is to do a "Delete unused images."
Is this a known issue? I'd hate to sacrifice image quality.
Any advice greatly appreciated.
Thanks.
The image is WAY too big to fit into any device and would crash many devices when they try to open it. The designer wasn't built to handle images so large, you can run it with more RAM but the solution is to use an image of realistic size.
A PSD file i'm working with has its icons designed IN PSD using layers that are a result of using magic wand, rectangle tool, circle tools etc.
For example, an icon can be made up of 4 different layers in 1 photoshop folder (ie using magic wand 2x, rectangle tool 1x, circle tool 1x)
I understand that if an icon in PSD were to be usable in code it should be in jpeg, png format, please correct me if I'm wrong as I'm new to this.
You are absolutely correct to be usable it should be either png or jpeg(there are others too). Png and 9 patch png are preferred in android. You can find more about it on the developers website.
I'm writing a game for Android and I was wondering what kind of images should I use for the in game graphics.
I told the customer to create the artwork in the highest possible (and reasonable) resolution and I will scale it down but I have been told lately that SVG would be better than plain PNG for example since there are a lot of resolutions used by Android devices and the images have to be scaled. Most of the graphics will be stationary backgorunds or objects but there will be some animations. I will use AnimationDrawable for this.
Is there some general guideline for graphical file formats (I checked out android developer site but didn't find anything) or just go with whatever I have at the moment?
I have been told lately that SVG would be better than plain PNG for example
Android does not support SVG natively. There are third-party libraries that support SVG, such as this one.
since there are a lot of resolutions used by Android devices and the images have to be scaled
If that is literally what your graphic designer told you, you need to hire a different graphic designer. Quickly.
Resolution is typically meaningless. What matters is screen size and, more importantly for graphics, screen density. Android supports multiple versions of an image for different densities, and can also resample images from one density into another, so you can "dial in" how many densities you wish to support directly. Here is a blog post from yesterday regarding screen density, and there is plenty of material in the Android documentation on this as well.
Now, your graphic designer might use SVG "internally" and generate density-scaled PNG files for your use -- that is perfectly reasonable.
Is there some general guideline for graphical file formats
Yes, here. It says
Android supports bitmap files in a three formats: .png (preferred), .jpg (acceptable), .gif (discouraged).
There is no native support for SVG drawables but there are libraries that support SVG
See SVG support on Android
You would typically convert SVG images to pixel images for each density. Android also defines some standard sizes for icons like Menu icons
Having the sources for the images you use as SVG is not a bad idea. SVG and other vector based graphics usually scale better to different sizes than pixel graphics. Especially if you need to enlarge an image (for example for the hi-res icons used in the Play store).
Also be careful with AnimationDrawable, it is not meant to be used for fullscreen animations. Just small animated icons and such.