image-manipulation

Resize Image to fit in bounding box

懵懂的女人 提交于 2019-12-28 07:59:53
问题 An easy problem, but for some reason I just can't figure this out today. I need to resize an image to the maximum possible size that will fit in a bounding box while maintaining the aspect ratio. Basicly I'm looking for the code to fill in this function: void CalcNewDimensions(ref int w, ref int h, int MaxWidth, int MaxHeight); Where w & h are the original height and width (in) and the new height and width (out) and MaxWidth and MaxHeight define the bounding box that the image must fit in.

How to reduce the size of an image in C# and .NET 3.5?

孤者浪人 提交于 2019-12-28 05:47:13
问题 I have a screen shot I take in my mobile app. The screen shot takes about 32 KB when saved as a png on a disk. I am sending these to a central SQL Server and 32 KB is too big for that amount of times I will need to store that screen shot (approx 2500 times a day). Is there any kind of trickery that I can do to get it to save smaller? Here is the code I am using now to take it from Bitmap to bytes (to send to the server for storage): MemoryStream stream = new MemoryStream(); _signatureImage

Image Processing, In Python? [closed]

倖福魔咒の 提交于 2019-12-27 16:26:39
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I've recently come across a problem which requires at least a basic degree of image processing, can I do this in Python, and if so,

Image Processing, In Python? [closed]

可紊 提交于 2019-12-27 16:26:33
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I've recently come across a problem which requires at least a basic degree of image processing, can I do this in Python, and if so,

Image Processing, In Python? [closed]

邮差的信 提交于 2019-12-27 16:26:24
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I've recently come across a problem which requires at least a basic degree of image processing, can I do this in Python, and if so,

Erase bitmap parts using PorterDuff mode

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-27 13:59:25
问题 I try to erase parts of a bitmap in my Android application by using Porter-Duff Xfermodes. I have a green background which is overlayed by a blue bitmap. When I touch the screen a "hole" in the overlaying bitmap is supposed to be created making the green background visible. Instead of a hole my current code produces a black dot. Below is my code. Any ideas, what I am doing wrong here? /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {

Erase bitmap parts using PorterDuff mode

江枫思渺然 提交于 2019-12-27 13:59:11
问题 I try to erase parts of a bitmap in my Android application by using Porter-Duff Xfermodes. I have a green background which is overlayed by a blue bitmap. When I touch the screen a "hole" in the overlaying bitmap is supposed to be created making the green background visible. Instead of a hole my current code produces a black dot. Below is my code. Any ideas, what I am doing wrong here? /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {

Separate/reposition/translate shapes in image with pillow in python

左心房为你撑大大i 提交于 2019-12-25 14:26:51
问题 I need to separate or translate or replace pixels in an image with python so as to all the shapes to share the same distance between each other and the limits of the canvas. background is white, shapes are black. IMPORTANT: Images are dynamic, all images have bars at different positions, that means i need to detect where a bar starts and where a bar ends to draw the final image! This is an example INPUT image This is an example OUTPUT image I did this by hand, i don't know if all bars are

create a new image with only masked part (without transparent area) with new size

不羁岁月 提交于 2019-12-25 05:16:18
问题 I have a mask and an image on which mask is applied to get a portion of that image. The problem is when I apply that mask on the image ,the resultant image from masking is of same size as the original image .Though the unmasked part is transparent. What I need is an image which only has the masked part of the original image ,I dont want transparent part to be in the image. so that the resultant image will be of smaller size an contain only the masked part. Thanks 回答1: You can: Draw the image

how to manipulate an image very fast in accordance to an own math function in python

試著忘記壹切 提交于 2019-12-25 04:25:02
问题 I'm trying to create a 360 degree camera just like google street cameras (This is my whole code if you are interested) I have a individual kind of perspective equation that map pixel [xold,yold] to [xnew,ynew] in accordance to Alpha and Beta angles as inputs. To simplify that equation and my question, i assume i'm just trying to rotate an image. Now my question is how to rotate an image by using rotation equation on each pixel very fast on pygame or anyother intractive shell: xnew = xold *