image-manipulation

Overlaying two images with automatic resize using ImageMagick

拈花ヽ惹草 提交于 2019-11-29 06:55:07
问题 Is there are way to automatically resize the overlay image according to background size when overlaying images using ImageMagick? I am using the following code now: composite overlay.jpeg background.jpeg result.jpeg The problem is that sometimes overlay and background are of different sizes, and I'd like to resize overlay accordingly (keeping the aspect ratio) and place it to the center. Is there any way to do that? 回答1: First of all, overlay and background do not need to be the same size for

How to resize an image in C# to a certain hard-disk size?

血红的双手。 提交于 2019-11-29 06:30:19
How to resize an image an image in C# to a certain hard-disk size, like 2MiB? Is there a better way than trial and error (even if it's approximate, of course). Any particular keywords to search for when trying to find the solution on the web? It depends on what you are willing to change Make the size of the image smaller Change the format of the image If the format supports a lossy compression, decrease the quality If you are storing meta-data that you don't need, remove it Reduce the number of colors (and bits per pixel) Change to a paletted format Change to a paletted format and reduce the

how to crop image in codeigniter?

こ雲淡風輕ζ 提交于 2019-11-29 05:11:18
i'm using codeigniter to build a project and right now i need to create a thumb depending on user choice. like he will give me X1,Y1,X2,Y2,X3,Y3,X4,Y4 i want to crop the image depending on that 4 points. i checked the image manipulation class. the crop function seems to be very strange. any help please ? I know that the documentation is sparse on this particular function in the image library. The crop function asks you only to supply to axises. It will then cut along these axes and return the part of the image which is closer to the center. So if you set the x axis to 10 and the y axis to 10

How to resize and save a Texture2D in XNA?

本小妞迷上赌 提交于 2019-11-29 04:51:54
In a level editor I've made for my XNA game (editor is also in XNA) I'm allowing to scale Texture2D objects. When the user tries to save the level, I'd like to actually resize the image file on disk so that it doesn't require scaling in the game. Is there an easy way to create an image file (PNG preferred) from a scaled Texture2D object? You can scale your textures by rendering to a render target at the size you want and then saving the render target texture. This simple example shows how you could do that. Ignore the setup of the GraphicsDevice, that's just to make a small self-contained

Cutting one image into multiple images using the Python Image Library

限于喜欢 提交于 2019-11-29 03:44:21
I need to cut this image into three parts using PIL and pick the middle part. How do I do it? http://thedilbertstore.com/images/periodic_content/dilbert/dt110507dhct.jpg If the boxes are not known on before hand I would run a simple edge finding filter over the image (both x and y directions) to find the boundaries of the box. A simple approach would be: Run horizontal edge filter over image. You now have an image where each pixel describes the changes in intensity left and right of that pixel. I.e. it will "find" vertical lines. For each column in the horizontal-edge-image get the average

How to capture an image in android with coordinates

╄→гoц情女王★ 提交于 2019-11-29 02:38:11
Am new to android , and I would like place my problem in-front of you,, I would like to capture an image between four coordinates , as below.. First of all I convert the image into bitmap and then set it as background to a relative layout. And i know these four coordinates. Then how could I get the image inside the box and set it to another layout as background. Guys please let me out from this logic.... finally i find the solution to my problem and i wana share it with you, first of all, this is done based on the theory of transformation at +12 level. Ok, My problem is solved with the help of

Resizing Images in VB.NET

房东的猫 提交于 2019-11-29 01:42:29
I'd like to make a simple VB utility to resize images using vb.net. I am having trouble figuring out what vb class to use to actually manipulate the images. The Image class and the Bitmap class don't work. Any ideas, hints, tips, tutorial links are greatly appreciated. Thanks. Here is an article with full details on how to do this. Private Sub btnScale_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnScale.Click ' Get the scale factor. Dim scale_factor As Single = Single.Parse(txtScale.Text) ' Get the source bitmap. Dim bm_source As New Bitmap(picSource.Image) '

Crop-to-fit image in Android

做~自己de王妃 提交于 2019-11-29 01:14:05
问题 I've been trying this for some time, I would like to create a wallpaper from a Bitmap . Let's say the desired wallpaper size is 320x480, and the source image size is 2048x2048. I'm not sure whether crop-to-fit is the right term, but what I would like to achieve is to get most part of the picture that has the equal ratio as the desired wallpaper size (320x480). So in this case, I would like to get 2048x1365 or (1365.333... to be exact) from the source Bitmap , and scale it down to 320x480. The

Rich image scroll and zooming on android

岁酱吖の 提交于 2019-11-29 01:12:17
问题 I'm looking for a way to implement image zoom and scrolling the way it is implemented in Droid Comic Viewer. Is there any quick way to do that? If not, then could you please give some advices at least on implementing kinetic scrolling. 回答1: It wasn't quick for us. When we implemented that part of Droid Comic Viewer we used the source code of ScrollView as reference to create a view able to handle horizontal and vertical scrolling. Scrolling and zooming have a lot of quirks that we gradually

RMagick remove white background from image and make it transparent

折月煮酒 提交于 2019-11-28 23:41:07
I need to remove the white background from this image and make the background transparent. So it's just a black tick on the transparent background exported as a png. e.g. Turn Into Any ideas? convert image.png -matte -fill none -fuzz 1% -opaque white result.png Replaces anything white with transparency. The fuzz option includes anything that is almost-white. I know I am pretty late to the party, but a lot has changed since this question was first posted, so here is how you can do it today using at least version 2.15.4 of rmagick Assuming you have the image somewhere accessible: image = Magick: