image-manipulation

PHP ImagickDraw with outlined text issues

天大地大妈咪最大 提交于 2019-12-03 20:32:53
I'm learning and practicing my Imagick skills. I have issues with outlined text using Imagick stroke. I would like to achieve an effect visible on this image: a popular Internet meme: Here's the code I have so far: $draw = new \ImagickDraw(); $outputImage = new \Imagick('meme.jpg'); $draw->setFillColor('#fff'); $draw->setFont('impact.ttf'); $draw->setFontSize(40); $draw->setGravity(\Imagick::GRAVITY_NORTH); $draw->setStrokeColor('#000'); $draw->setStrokeWidth(1); $draw->setStrokeAntialias(true); $draw->setTextAntialias(true); $outputImage->annotateImage($draw, 0, 5, 0, 'Sample text');

Losing colors when resizing jpegs in Java (tried with multiple libraries)

≯℡__Kan透↙ 提交于 2019-12-03 17:20:35
问题 I've tried multiple image resizing libraries posted here on SO, as well as with raw java using getScaledInstance . While everything works most of the time, there are two jpeg images for which the colors are always messed up whenever I resize them. First image: Result: Second image: Result: I've tried these images with multiple libraries including Scalr, Thumbnailator, and raw java using image.getScaledInstance() (see here for code), but the result is the same. Any ideas what the problem is?

How can i crop image using C#

橙三吉。 提交于 2019-12-03 16:31:29
I have a picture of document taken from camera. Now what i have to do is crop only document from that image . Please can anyone suggest me how best it can be done or first is it possible or not Edit For more information .. my next question How to get edge coordinates of a image? If you know the area that contains the image data you would like to crop, you could use this article from MSDN: http://msdn.microsoft.com/en-us/library/ms752345.aspx If you need to find the relevant area before cropping, you need to investigate some image processing techniques. e.g. Corner Detection In the assumption

.Net Core Image Manipulation (Crop & Resize) / File Handling

落爺英雄遲暮 提交于 2019-12-03 15:24:55
问题 I have spent the last 5 hours trying to find a feasible way to accomplish what seems to me quite an easy task if it was a previous version of the .NET family that I was working with: Uploading a picture Resizing & Cropping the picture Saving the new picture into a directory I have come accross to couple of libraries that are either in pre-release stage or in a not-complete stage. Has anyone at all accomplished the above tasks without specifically including the System.Drawing namespace and/or

Positioning image on Google Maps with rotate / scale / translate

别等时光非礼了梦想. 提交于 2019-12-03 14:36:25
I'm developing a user-interface for positioning an image on a google map. I started from : http://overlay-tiler.googlecode.com/svn/trunk/upload.html which is pretty close to what I want. But instead of 3 contact points I want a rotate tool, a scale tool and a translate tool (the later exists). I tried to add a rotate tool but it doesn't work as I expected : I put a dot on the left bottom corner that control the rotation (around the center of the image). The mouse drag the control dot and I calculate the 3 others points. My code is based on the mover object but I changed the onMouseMove

RAW Image file - what format is my data in?

拟墨画扇 提交于 2019-12-03 12:29:18
I'm working on processing .raw image files, but I'm not sure how the image is being stored. Each pixel is a unsigned 16-bit value, with typical values ranging from 0 to about 1000 (in integer form). This isnt enough bits for hex values, and its not RGB (0-255) so I'm not quite sure what it is. Bonus: if you have any idea on how to convert this to grayscale in OpenCV (or just mathematically) that would be a huge help too. The name RAW comes from the fact that the values stored in the file are not pixel RGB values, but the raw values that were measured from the camera itself. The values have

C# image whitespace

喜你入骨 提交于 2019-12-03 11:39:57
I have an image that is 240x320 (iphone camera image in portrait), and I need to programmatically (in C#) add white "bars" to the sides increasing the full image size to 320x320. I don't want to scale the image because that would mess up the aspect ratio. I have found a lot of info about how to remove white bars with c#, but nothing about how to add them. I am at a loss. Does anyone have any input that might lead me the correct direction? Thanks a bunch, Brett munissor using (System.Drawing.Image src = System.Drawing.Image.FromFile("picture.jpg")) { using (Bitmap bmp = new Bitmap(320, 320)) {

How to efficiently and fast blur an image on the iPhone?

一世执手 提交于 2019-12-03 11:17:17
问题 If I have a UIImage or CGContextRef or the pure bitmap data (direct access to decompressed ARGB-8 pixels), what's my best option to blur an image with radius 10 pixels as fast as possible? 回答1: Either use a stack blur, a box blur or use the OpenGL texture blur (google the first two, and check the Apple dev samples for the latter). 回答2: I've implemented a stackBlur algorithm for iOS, which is close to GaussianBlur but very fast: https://github.com/tomsoft1/StackBluriOS Check for instance here:

How to composite several NSImages into one big image?

给你一囗甜甜゛ 提交于 2019-12-03 10:27:17
I have a collection of objects which describe an image-name, its size and it's X/Y location. The collection is sorted by "layers", so I can composite the images in a sort of painter's algorithm. From this, I can determine the rectangle necessary to hold all of the images, so now what I want to do is: Create some sort of buffer to hold the result (The NS equivalent of what iPhoneOS calls UIGraphicsContext.) Draw all the images into the buffer. Snag a new NSImage out of the composited result of the buffer. In iPhoneOS, this is the code that does what I want: UIGraphicsBeginImageContext (woSize);

Getting a particular Portion of Image (Picture)

血红的双手。 提交于 2019-12-03 09:42:33
I want to cut the the specific portion of the the picture and use it to compare the cropped image with another stored in the HDD. The problem is that I don't know how to get a specific section of the source image. I know the location (X,Y) of the image to be cropped. This will load the original and create a cropped version starting at (0,0) and with dimensions of 64x64. Bitmap original = new Bitmap( @"C:\SomePath" ); Rectangle srcRect = new Rectangle( 0, 0, 64, 64 ); Bitmap cropped = (Bitmap)original.Clone( srcRect, original.PixelFormat ); BTW, you don't specify if this is WinForms or WPF, so