button in PSD as multiple layers into mobile code java - java

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.

Related

Best way to working with motion design in Android?

As a study project I am working on an application that will show the wind forecast and display an animated drone. Something like LottieAnimations. So I made a 3D quadcopter in Blender and added some animations to it. Now I want to add it to my android app. What is the best way to do this? Use video, GIF or something else?
I have an mp4 file (1.4 MB) but seems use VdeoView aint right. There is also a GIF file (18 MB), but there is no built-in animation support for GIF, and it is too big.
My animation
Thanks

How can I convert HTML with CSS3 & SVG to an image - preferably from Java?

I'm trying to find a way to rasterize HTML quickly and efficiently at scale. Preferably this would use Java, but I'm open to other options as well.
Given an HTML input that has CSS3 including 3D transforms and SVG, I want to create a PNG that could be served to older browsers or used as a thumbnail on social media. The idea is that I might have an SVG on a webpage which then uses CSS3 to provide 3D perspective and I want an image from it.
Is there a pure Java way to do this? I want to do these conversions in a server environment (headless). If not, something like PhantomJS, but that doesn't support CSS 3D transforms. Of course I could use Batik to convert an SVG to an image, but the key here is getting HTML using a CSS 3D transform to get rasterized.
Bonus points if I could take a page with CSS3 or SVG animation and create multiple frames from that to make an animated gif.
You could use nodeshot which directly supports CSS 3D and HTML5 or possibly try slimer-js(I haven't checked too closely on this one). Also, once you have screenshots pulled, you could use FFMPEG to combine the images into an animated GIF.

What kind of image formats should I use in an Android application?

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.

Best image format for tray icon

I created a Java application with tray icon. I am using a transparent png image. However, the rendered icon is very ugly on all platforms, including Windows 7 and Linux.
Are there any good practices for creating tray icons (e.g. format, size, etc.)?
In windows, you should use the .ico format. It may contain multiple icons with different sizes.
In Linux I guess png is the standard. Just don't try to scale it. Pre-create multiple versions of the same image with different sizes.
There is no "known solution" for this problem as far as i know. You should switch your transparent icons to square ones. You can check this question for deeper information;
java TrayIcon using image with transparent background

Generate photo SlideShow in Java and Export as Video

I want to create a cross platform SlideShow maker desktop-application (mainly Windows & Mac), the SlideShow will be generated using a set of images with background music, subtitles/captions and there will be a transition between each slide/image.
I have done all the UI in swing and it all works superb on Windows & Mac. Now the only "little" problem is
How to generate a video from a set of images with "transitions" & "subtitles" in java using native java libs/frameworks and add some music in background ;-)
I want the video output format to be at least in avi & mov, with transitions like:
1) fade
2) Zoom (images will zoom-in from e.g. 64x64 to full video size)
3) Multiple (multiple images will appear in single slide)
I have used JMF example to generate .mov from .jpeg images it was buggy but may work if I can add transitions?? But it appears JMF is mainly for media playback it only supports a few media formats (for output).
I have also read a few docs of jffmpeg but it appears it too does not support transitions.
I have also tried FMJ but no use, now I am stuck and need assistance, on how this task can be done in java.
I would be immensely thankful if anyone can guide me in right direction.
--
many thanks
I think you can accomplish this task with xuggler. Check it out. It might fit you needs.
Xuggler

Categories