image-manipulation

Blend overlapping images in python

梦想的初衷 提交于 2020-05-09 19:12:38
问题 I am taking two images in python and overlapping the first image onto the second image. What I would like to do is blend the images where they overlap. Is there a way to do this in python other than a for loop? 回答1: PIL has a blend function which combines two RGB images with a fixed alpha: out = image1 * (1.0 - alpha) + image2 * alpha However, to use blend , image1 and image2 must be the same size. So to prepare your images you'll need to paste each of them into a new image of the appropriate

Border around Image

时光毁灭记忆、已成空白 提交于 2020-02-06 04:24:10
问题 I want to put border around regular size image using php. I m wondering that i found border for text to image but not for simple images. The border width may be changeable. Please help 回答1: The img element has by default a border attribute http://www.w3schools.com/tags/tag_IMG.asp Not a php expert but I would also opt for having a dynamic var inside of the tag itself so that it is fully flexible 回答2: I would not manipulate the images using GD or imagemagick but instead put a [css border][1]

Return Bitmap to Browser dynamically

眉间皱痕 提交于 2020-01-24 08:45:05
问题 I am cropping an image, and wish to return it using a ashx handler. The crop code is as follows: public static System.Drawing.Image Crop(string img, int width, int height, int x, int y) { try { System.Drawing.Image image = System.Drawing.Image.FromFile(img); Bitmap bmp = new Bitmap(width, height, PixelFormat.Format24bppRgb); bmp.SetResolution(image.HorizontalResolution, image.VerticalResolution); Graphics gfx = Graphics.FromImage(bmp); gfx.SmoothingMode = SmoothingMode.AntiAlias; gfx

How to make circle thumbnail with GraphicsMagick?

本小妞迷上赌 提交于 2020-01-23 03:39:11
问题 While exploring how to make circular crop with GraphicsMagick i came to that code: gm convert -thumbnail 200x200^ -extent 200x200 kira.jpg kira_new.jpg && gm convert -size 200x200 xc:none -fill white -draw "circle 100,100 110,0" tmp.png && gm composite -compose CopyOpacity tmp.png kira_new.jpg out.png Here's what it does: Creates 200x200 temp file named kira_new.jpg Creates transparent tmp.png with white circle in the middle Composition on tmp.png and kira_new.jpg So the question is: is there

How do I use CSS to add a non-rectangular border around an image?

空扰寡人 提交于 2020-01-15 10:11:24
问题 I have three images, and they are not square or rectangular in shape. They are just like face of anyone. So, basically, my images are in the size 196x196 or anything like that, but complete square or rectangle with the face in the middle and transperant background in the rest of the portion. Now, I want to remove the transperant background too and just keep the faces. Don't know if this is possible and mind you, this isn't a programming question. EDIT (from comments): How do I put a border

Pixastic doesn't work properly for me, why?

拟墨画扇 提交于 2020-01-15 08:41:46
问题 I need to do some interactive image processing on a webpage. I found pixastic and it seemed good for the job. On this page I'm trying do blur an image, but I can only get "blurfast" to work. "blur" doesn't work for me. I've been looking around and reading the documentation and can't see why it fails. Has anyone any idea? I use this js: $(function(){ var img = document.getElementById("imageone"); $("#blurfastbutton").click(function() { Pixastic.process(img, "blurfast", {amount:0.2}); }); $("

How to click through a display object in Flash with AS3?

三世轮回 提交于 2020-01-13 18:54:47
问题 I am creating a photo editor app where, at some point, the photo you edit is supposed to be dropped between two layers of DisplayObjects (a background image and an image mask.) There is a problem, though. When the image you are editing is dropped between the background and the image mask layers, it becomes unclickable, and therefore gets stuck there, with no chance of dragging it again. (The photo editor uses TransformManager library.) I am looking for a way to allow you to select the image

Create drop shadow effects in Imagemagick

拟墨画扇 提交于 2020-01-13 10:13:26
问题 The border shadow effects used in the images of this blog post seem to be embeded in the images themselves (not css3). How can it be created in imagemagick? Edit 1: The solution which I found quite accidentlly is posted below as an answer. 回答1: There is a -shadow argument on convert that has options to do this. http://blog.bemoko.com/2009/07/01/add-shadow-and-border-to-images-with-imagemagick/ 回答2: Somehow I found the command which does what I wanted exactly: For images which are already

LockBits Performance Critical Code

醉酒当歌 提交于 2020-01-13 05:23:10
问题 I have a method which needs to be as fast as it possibly can, it uses unsafe memory pointers and its my first foray into this type of coding so I know it can probably be faster. /// <summary> /// Copies bitmapdata from one bitmap to another at a specified point on the output bitmapdata /// </summary> /// <param name="sourcebtmpdata">The sourcebitmap must be smaller that the destbitmap</param> /// <param name="destbtmpdata"></param> /// <param name="point">The point on the destination bitmap

guassian smoothening formula application

可紊 提交于 2020-01-12 23:14:49
问题 How to apply guassian smoothening formula for a graph which is in array? these array are mapped to a color and plotted on the graph. i want the linear gradient of color after applying guassian smoothening.. I want to know the exact guassian smoothening formula too. 回答1: I believe what you're asking for is typically called a "Gaussian blur" in photo-editing applications. It is simply the result of blurring an image using a Gaussian function, resulting in a reduction of visual noise and detail.