image-manipulation

Image rotation algorithm

那年仲夏 提交于 2019-12-17 18:21:38
问题 I'm looking for an algorithm that rotates an image by some degrees (input). public Image rotateImage(Image image, int degrees) (Image instances could be replaced with int[] containing each pixel RGB values, My problem is that i need to implement it for a JavaME MIDP 2.0 project so i must use code runnable on JVM prior to version 1.5 Can anyone help me out with this ? EDIT: I forgot to mention that i don't have SVG APIs available and that i need a method to rotate by arbitrary degree other

Using the Image.point() method in PIL to manipulate pixel data

六眼飞鱼酱① 提交于 2019-12-17 18:14:47
问题 I am using the Python Imaging Library to colorize a black and white image with a lookup table that defines the color relationships. The lookup table is simply a 256-element list of RGB tuples: >>> len(colors) 256 >>> colors[0] (255, 237, 237) >>> colors[127] (50, 196, 33) >>> My first version used the getpixel() and putpixel() methods: for x in range(w): for y in range(h): pix = img.getpixel((x,y)) img.putpixel((x,y), colors[pix[0]]) This was horribly slow. A profile report pointed to the

Create a BufferedImage from file and make it TYPE_INT_ARGB

徘徊边缘 提交于 2019-12-17 17:39:51
问题 I have a PNG file with transparency that is loaded and stored in a BufferedImage . I need this BufferedImage to be of TYPE_INT_ARGB . However, when I use getType() the returned value is 0 ( TYPE_CUSTOM ) instead of 2 ( TYPE_INT_ARGB ). This is how I load the .png : public File img = new File("imagen.png"); public BufferedImage buffImg = new BufferedImage(240, 240, BufferedImage.TYPE_INT_ARGB); try { buffImg = ImageIO.read(img ); } catch (IOException e) { } System.out.Println(buffImg.getType()

Looking for an Image Comparison/Pattern Recognition Library

拥有回忆 提交于 2019-12-17 15:45:12
问题 The end goal would be to see if contains . the compare needs to support minor distortion, scaling, color differences, rotation, and brightness differences. it can be in any language really. i will be running this algorithm as a webservice so its no problem if i have to write this portion in c, c++, python, etc. 回答1: You should probably take a look at OpenCV and VLfeat. 回答2: Object detection can be performed for example using Rapidminer IMMI (image mining extension for one of the leading open

UIImage Rotation custom degrees

夙愿已清 提交于 2019-12-17 15:42:41
问题 I have been using the code in this sample to assist and this works well. http://www.platinumball.net/blog/2009/03/30/iphone-uiimage-rotation-and-mirroring/ I cannot workout how to rotate by a custom amount of degrees between 0 & 360.... 回答1: You'll want to do pretty much the same stuff as in that post does in rotate: CGSize size = sizeOfImage; UIGraphicsBeginImageContext(size); CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextRotateCTM(ctx, angleInRadians); CGContextDrawImage(ctx,

UIImage Rotation custom degrees

丶灬走出姿态 提交于 2019-12-17 15:42:16
问题 I have been using the code in this sample to assist and this works well. http://www.platinumball.net/blog/2009/03/30/iphone-uiimage-rotation-and-mirroring/ I cannot workout how to rotate by a custom amount of degrees between 0 & 360.... 回答1: You'll want to do pretty much the same stuff as in that post does in rotate: CGSize size = sizeOfImage; UIGraphicsBeginImageContext(size); CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextRotateCTM(ctx, angleInRadians); CGContextDrawImage(ctx,

Merge Image using Javascript

浪尽此生 提交于 2019-12-17 15:25:20
问题 Is it possible to merge pictures using javascript? For example, if you have 2 rectangle .jpg or .png images files of the same size, is it possible that you can align it side by side and produce a merged copy of the two in a new .jpg or .png image file? 回答1: You can use JavaScript to 'merge' them into one canvas, and convert that canvas to image. var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); var imageObj1 = new Image(); var imageObj2 = new Image(); imageObj1.src = "1

rotating bitmaps. In code

回眸只為那壹抹淺笑 提交于 2019-12-17 06:07:07
问题 Is there a faster way to rotate a large bitmap by 90 or 270 degrees than simply doing a nested loop with inverted coordinates? The bitmaps are 8bpp and typically 2048*2400*8bpp Currently I do this by simply copying with argument inversion, roughly (pseudo code: for x = 0 to 2048-1 for y = 0 to 2048-1 dest[x][y]=src[y][x]; (In reality I do it with pointers, for a bit more speed, but that is roughly the same magnitude) GDI is quite slow with large images, and GPU load/store times for textures

rotating bitmaps. In code

 ̄綄美尐妖づ 提交于 2019-12-17 06:07:03
问题 Is there a faster way to rotate a large bitmap by 90 or 270 degrees than simply doing a nested loop with inverted coordinates? The bitmaps are 8bpp and typically 2048*2400*8bpp Currently I do this by simply copying with argument inversion, roughly (pseudo code: for x = 0 to 2048-1 for y = 0 to 2048-1 dest[x][y]=src[y][x]; (In reality I do it with pointers, for a bit more speed, but that is roughly the same magnitude) GDI is quite slow with large images, and GPU load/store times for textures

How to stretch images with no antialiasing

眉间皱痕 提交于 2019-12-17 04:31:29
问题 So I ran across this recently: http://www.nicalis.com/ And I was curious: Is there a way to do this sort of thing with smaller images? I mean, it's pixel art, and rather than using an image with each pixel quadrupled in size couldn't we stretch them with the code? So I started trying to make it happen. I tried CSS, Javascript, and even HTML, none of which worked. They all blur up really badly (like this: http://jsfiddle.net/nUVJt/2/), which brings me to my question: Can you stretch an image