image-manipulation

Slicing up a UIImage on iPhone

混江龙づ霸主 提交于 2019-12-18 10:19:22
问题 Objective: take a UIImage, crop out a square in the middle, change size of square to 320x320 pixels, slice up the image into 16 80x80 images, save the 16 images in an array. Here's my code: CGImageRef originalImage, resizedImage, finalImage, tmp; float imgWidth, imgHeight, diff; UIImage *squareImage, *playImage; NSMutableArray *tileImgArray; int r, c; originalImage = [image CGImage]; imgWidth = image.size.width; imgHeight = image.size.height; diff = fabs(imgWidth - imgHeight); if(imgWidth >

Creating mask with CGImageMaskCreate is all black (iphone)

大兔子大兔子 提交于 2019-12-18 10:12:02
问题 I'm trying to create an image mask that from a composite of two existing images. First I start with creating the composite which consists of a small image that is the masking image, and a larger image which is the same size as the background: UIImage * BaseTextureImage = [UIImage imageNamed:@"background.png"]; UIImage * MaskImage = [UIImage imageNamed:@"my_mask.jpg"]; UIImage * ShapesBase = [UIImage imageNamed:@"largerimage.jpg"]; UIImage * MaskImageFull; CGSize finalSize = CGSizeMake(480.0,

imagecopyresampled in PHP, can someone explain it?

僤鯓⒐⒋嵵緔 提交于 2019-12-18 07:04:09
问题 OK i thought i understood this function but i have a complete mental block on this one. I wanted to create cropped thumbnails of size 75x75 from photos that are 800x536. the imagecopyresampled function has 10 possible parameters. i first tried this: // Starting point of crop $tlx = floor(($width / 2) - ($new_width / 2)); //finds halfway point of big image and subtracts half of thumb. $tly = floor(($height / 2) - ($new_height / 2)); //gets centre of image to be cropped. imagecopyresampled($tmp

imagecopyresampled in PHP, can someone explain it?

这一生的挚爱 提交于 2019-12-18 07:04:06
问题 OK i thought i understood this function but i have a complete mental block on this one. I wanted to create cropped thumbnails of size 75x75 from photos that are 800x536. the imagecopyresampled function has 10 possible parameters. i first tried this: // Starting point of crop $tlx = floor(($width / 2) - ($new_width / 2)); //finds halfway point of big image and subtracts half of thumb. $tly = floor(($height / 2) - ($new_height / 2)); //gets centre of image to be cropped. imagecopyresampled($tmp

how to crop image in codeigniter?

自古美人都是妖i 提交于 2019-12-18 04:25:09
问题 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 ? 回答1: 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

Resizing Images in VB.NET

若如初见. 提交于 2019-12-18 03:22:06
问题 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. 回答1: 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

Any idea why this image masking code does not work?

时光怂恿深爱的人放手 提交于 2019-12-18 02:46:15
问题 I have this code to mask an image. Basically, I only work with PNG images. So I have a 300x400 PNG image with 24bits of color (PNG-24). I am not sure if it also has an alpha channel. But there's no transparency in it. Then, there is the image mask which is PNG-8bit without alpha channel. It is just black, grayscale and white. I create both images as UIImage. Both display correctly when putting them into an UIImageView. Then I create an UIImage out of them which contains the results of the

Cutting one image into multiple images using the Python Image Library

帅比萌擦擦* 提交于 2019-12-18 02:42:25
问题 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 回答1: 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

How do I equalize contrast & brightness of images using opencv?

拟墨画扇 提交于 2019-12-17 23:44:14
问题 I've got an image that I've scanned, but the white paper is not white on the screen. Is there a way to equalize the contract/brightness to make the background whiter? Update I've tried the suggested Image._EqualizeHist function from EmguCv: string file = @"IMG_20120512_055533.jpg"; Image<Bgr, byte> originalColour = new Image<Bgr, byte>(file); Image<Bgr, byte> improved = originalColour.Clone(); improved._EqualizeHist(); But get an even worse result (also when first gray scaled): Am I missing

how to implemet Digital picture frame in ios app? [closed]

懵懂的女人 提交于 2019-12-17 21:34:50
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I want to develop an application which shows photos like digital picture frame (One by one photo slides automatically and shows animation). How to do it ? Is there any sdk available or I have to do it by my own logic ? Please help me if anyone can suggest any reference link. 回答1: This is not exactly an answer