image-manipulation

Change color in java.awt.Image?

假装没事ソ 提交于 2019-12-25 02:25:08
问题 I have an java.awt.Image object. It is an colorful image. Here is my code: ImageIcon icon = new ImageIcon(bytes); Image image = icon.getImage(); How can I make it black & white? 回答1: Look into using a BufferedImageOp. See Drawing an Image in the Java Tutorials for more details. 来源: https://stackoverflow.com/questions/5165808/change-color-in-java-awt-image

How Create a new Image by merging two images

眉间皱痕 提交于 2019-12-24 19:03:11
问题 I want to Create a new image from two different Images .Output image must be result from overlaying one Image on other image by using drag ,zoom in/out, rotate actions. I am new to Android how can i do that. which view i need to use surfaceview/imageview ???? Thanks for your time. 回答1: It's not clear if you want to do this dynamically (in response to user actions) or whether you want to generate a fixed image based on specified drag/zoom/rotate parameters. For the former, you should go with a

Color reduction (in Java)

∥☆過路亽.° 提交于 2019-12-24 12:08:43
问题 I would like to find a way to take JPEG (or GIF/PNG) images and reduce the amount of colors to e.g. 20. Could someone recommend some library or other reference? Also source codes in other languages are welcome. 回答1: Take a look at the Java Advanced Imaging API. There are a number of algorithms implemented in that API for doing color reduction. 回答2: JAI (Java Advanced Imaging API) would do the work but it has some drawbacks. The API is far from being easy to use, especially if you care about

How to concatenate three or more images vertically?

元气小坏坏 提交于 2019-12-24 11:24:02
问题 I try to concatenate three images vertically and I need some assistance with the code/function. So far I imported one image and cropped 3 smaller images with the same size. Now I want to concatenate them in one image that will be long, but narrow. However, I can't find an appropriate function or even if I find one I get an error message when I apply it to my code. I already tried to make a collection from my three pictures and then use the function skimage.io.concatenate_images(sf_collection)

How to use PHP GD to create 1 bit bitmaps (black and white only, no gray)

笑着哭i 提交于 2019-12-24 10:55:32
问题 My goal I have an existing PNG. It currently has anti-aliasing, or in other words, shades of gray. I want the image to be 1 bit, or in other words, only using the colors black and white. My aim is to do this with PHP GD. I have to do this with an existing image, and can not create the image from scratch using imagecreatetruecolor. What I'm trying The function I've found that seems best for the job is imagetruecolortopalette http://php.net/manual/en/function.imagetruecolortopalette.php Here is

PHP image_jpeg dont' work if file is UTF-8, works if it's ANSI

半腔热情 提交于 2019-12-24 08:21:05
问题 I use this class to crop, resize my image: http://www.phpclasses.org/package/4268-PHP-Resize-crop-rotate-flip-flop-and-grey-images.html It uses GD. The problem is that I for example do this: $img = new ImageTransform; $img->view('resize', 'foo.jpg', '500x400', true); // true argument is $cache = true Now I can just point <img src="that_script.php" alt="" /> and it will show that image resized. But it doesn't if all my files are UTF-8! Only if they ALL are ANSI encoded. The image simply won't

Responsive alternative to Aviary for mobile

若如初见. 提交于 2019-12-24 05:32:08
问题 Since Aviary does not plan on having a responsive image editor in the near future (e.g., not great on mobile safari), does anyone know of alternatives? This is where they say that responsive is not in the near future: http://support.aviary.com/forums/191584-developer-feedback/suggestions/3718022-fully-responsive-web-editor-for-mobile-sites 回答1: You can use the following css, to make the aviary editor popup responsive. This is the only solution: @media all and (max-width: 640px) { html {

Render a section of an image to a Bitmap C# Winforms

霸气de小男生 提交于 2019-12-24 00:54:47
问题 I'm working on a Map Editor for an XNA game I'm designing in my free time. The pieces of art used in the map are stored on a single texture and rectangles are stored with coordinates and widths etc. In the winforms application I can add segments by selecting the segment I want from a listbox, which is populated from the array of possible segments. Problem is I would like to be able to show a preview of the segment selected and, since it is stored on a common texture, I cant simply set a

image transformations

☆樱花仙子☆ 提交于 2019-12-24 00:34:17
问题 So I've been using gnu-gsl and CImg to implement some of the fundamental projective space techniques for affine and metric rectification. I've completed computing an affine rectification but, I'm having a hard time figuring out how to apply the affine rectification matrix to the original (input) image. My current thought process is to iterate across the input image for each pixel coordinate. Then multiply the original pixel coordinate (converted to a homogeneous coordinate) by the affine

How can I convert a color image to grayscale in MATLAB?

南楼画角 提交于 2019-12-23 07:26:17
问题 I am trying to implement an algorithm in computer vision and I want to try it on a set of pictures. The pictures are all in color, but I don't want to deal with that. I want to convert them to grayscale which is enough for testing the algorithm. How can I convert a color image to grayscale? I'm reading it with: x = imread('bla.jpg'); Is there any argument I can add to imread to read it as grayscale? Is there any way I change x to grayscale after reading it? 回答1: Use rgb2gray to strip hue and