Parse a png image into many png images in J2ME - java-me

Can anyone tell me how i can parse a png image into many png images in J2ME ? I want to write a code that take a image and give many images that have equal pixels.

You mean you want to cut it into smaller images?
Load the image.
Convert to a bitmap.
Encode arbitrary rectangles as PNG.
Save the PNGs.
Unfortunately, I don't know anything about image processing usinf J2ME libraries.
Here's what I googled as far as loading a PNG in J2ME.
Using that, you'll be able to see the API calls used, and following the import list, you'll get to the classes used. Look at those class's methods, and yu'll probably come up with what you need.
I did this mostly because you're having an emergency, but frankly, you could have googled this yourself, or composed a question that was clearer, which would have led to someone more knowledgeable about J2ME image processing helping you.
Just don't panic, take a breath, google for what you need, you'll be fine.

Related

What is the most lightweight method to load different image file formats in nodejs and read pixels?

Is there a unified and lightweight method for loading multiple common image file formats in NodeJS which provides read access to individual pixels?
It should support gif, jpeg, and png.
Preferably it would either support other image formats too or provide a way to add more. (webp, etc.)
It does not need to be able to save the file again after modifying pixels, provide metadata access, or anything else.
It doesn't need to be able to load images from URLs.
So far the libraries that support multiple image formats are heavyweight, such as providing full canvas support or full image processing support.
Is there a lightweight way to do this that I'm not finding?
I don't know why I couldn't find this one before posting here:
get-pixels
Given a URL/path, grab all the pixels in an image and return the result as an ndarray. Written in 100% JavaScript, works both in browserify and in node.js and has no external native dependencies.
Currently the following file formats are supported:
PNG
JPEG
GIF
It hasn't had any updates for two years but seems the most lightweight. I'm guessing people might mostly use Jimp these days. It doesn't seem to have external dependencies and is actively developed, but includes a lot of image processing functionality I don't need.

How to extract metadata and structure from Fireworks PNG files for conversion?

Since Adobe has declared Fireworks dead, it is apparent that many of us are potentially locked into Fireworks in terms of the proprietary layered PNG format that they have used. I have been hunting for options to extract / convert my documents over to either PSD's or some other layered SVG structure (perhaps similar to what Sketch does on OS X).
Anyone have any ideas for extracting the contents of Fireworks' PNGs programmatically? So far I haven't seen any libraries to make this feasible and really no discussion of how the metadata is structured in a Fireworks PNG in a format that would help to reverse engineer this format for proper conversion and extraction.

Identify Photos vs. Graphics

Is there a way to write a program that can identify photos vs. graphic images in a folder of jpg files?
sample photo
http://dansdemos.info/clips/samples/photo.jpg
sample graphic image
http://dansdemos.info/clips/samples/graphic.jpg
I was thinking ImageMagic compare could do it, if it was provided a set of samples it could use to calculate differences between images. I was thinking coming up with that might be tricky, so I was hoping there might be a simpler approach. Maybe something as simple as a Google search I have not thought of. Any help or comment would be much appreciated. Thank you.
You could have the program check for Exif data of various kinds, like the camera manufacturer.
It wouldn't be foolproof, but it would probably work in most cases, as long as the Exif data hasn't been removed from photos by some postprocessing step.
It worked just fine on your two sample images. E.g. your photo of guinea fowl has Exif data for camera maker, camera model, f-stop, exposure, etc. The graphic.jpg appears to have none of those.

Retrieve the pixel values of an image with Haskell

Is there a way or a library available that can load an image (jpeg, png, etc) and assign the pixel values of that image into a list or matrix? I'd like to do some experiments with image and pattern recognition.
A little nudge in the right direction would be appreciated.
You can use JuicyPixels, a native Haskell library for image loading. This is rather easy to convert to REPA as well (manually or with JuicyPixesl-repa).
I've used the repa-devil package for this in the past. It lets you work with a bunch of formats using Developer's Image Library (DevIL). You can read and write all the formats you are likely to care about.
The actual image data is given as a Repa array. This is a great library for array operations and makes it very easy to write parallel code.
Try the repa library
.Also there is a small tutorial here
Here is a new Haskell Image Processing library, which uses JuicyPixels for encoding, provides interface for you to read and write all of the supported formats in a very easy manner and manipulate them in any way you can imagine. Just as a simple example on how easy it is:
>>> img <- readImageRGB "image.jpg"
>>> writeImage "image90.png" $ rotate90 img
Above will read a JPG image in RGB color space, rotate it 90 degrees clockwise and save it as a PNG image.
Oh yeah, it also can use Repa, so you will get parallel processing for free as well.
GTK supports loading and saving JPEG and PNG. [AFAIK, no other formats though.] There is a Haskell binding named Gtk2hs. It supports vector graphics very well, but bitmap graphics, while supported, isn't especially easy to figure out. So I wrote AC-EasyRaster-GTK, which wraps GTK in a more friendly interface. (It still needs Gtk2hs though.) The only real down-side is that Gtk2h is a bit fiddly to set up on Windows. (And it's arguably overkill to install an entire GUI toolkit just to load and save image files.)
I gather the "GD" library supports writing several image formats, and is quite small and simple. I believe Hackage has Haskell bindings for GD as well. I haven't tried this personally.
There is a file format called PPM which is deliberately designed to be ridiculously easy to implement (it's a tiny header and then an array of pixels), and consequently there's at least a dozen packages on Hackage which implement it (including my own AC-PPM). There are also lots of programs out there which can display and/or convert images in this format.

Need to know standards for png file in web graphics?

I'm starting to venture out from using jpeg and gif files to png, I was wondering if there were any standards for using png beside IE's lack of support for it. I also want to know if there was any current articles about setting I should be using when optimizing for web? Right now I'm using photoshop to do this, should I be using firework instead?
Which optimizations you use depends on the type of image. If your image contains only few colors, you might use png-8, otherwise you may need png-24. Same goes for the use of transparency/alpha blending.
The Photoshop save for web-feature does a fine job, but when your website has a lot of visitors, you may benefit from using PNGCrush for further compressing your images. You can use the YSlow plugin for FireFox to test how much bandwidth you can save by crushing your images.
Also, you can make use of CSS-sprites if your design allows it. This can result in less (but larger) images and therefore less requests and sometimes less bandwidth. But this doen't depend on the type of images you use.
Png is supported by IE, by the way. Only the alpha-transparency is not supported by IE 6, but there are CSS/Javascript trics to work around that, although they do not work for background images.
I wouldn't quit using jpg. Jpg is very useful when it comes to pictures. Png files are convenient for small images like buttons, graphical elements, and for images with large plain areas, like screenshots.

Resources