image-manipulation

Adding an Image to a Canvas in Android

泄露秘密 提交于 2019-12-07 12:45:08
问题 Good Day Everyone I was hoping if you could help me understand the concepts of understanding how to add an image into a canvas on a OnTouchEvent implemented on a View. So far, this is what i've come up with. parent is the Activity where in this customized view is instantiated and is added into. @Override protected void onDraw(Canvas canvas) { // TODO Auto-generated method stub super.onDraw(canvas); } public void insertImage() { if (parent.selected_icon.contentEquals("image1")) { image =

Saving a modified image to the original file using GDI+

余生长醉 提交于 2019-12-07 10:20:25
问题 I was loading a Bitmap Image from a File. When I tried to save the Image to another file I got the following error "A generic error occurred in GDI+". I believe this is because the file is locked by the image object. Ok so tried calling the Image.Clone function. This still locks the file. hmm. Next I try loading a Bitmap Image from a FileStream and load the image into memory so GDI+ doesn't lock the file. This works great except I need to generate thumbnails using Image.GetThumbnailImage

Image Processing in C# - A smart solution?

主宰稳场 提交于 2019-12-07 10:17:00
问题 I have an image with letters in it, the letters are in two colors black and blue, I want to read the blue colored letters from the image. Can anyone suggest me a method to do this in C#. Iam studying GDI+,but still didn't get any logic to develop this program.. I tried OCRing it, but the issue with common OCRs is that they dont recognize the color difference. I only want to read the Blue characters.... Any guidance is highly appreciated. 回答1: Try this one ;) But that's unsafe code. void

Gray scale image to color

≯℡__Kan透↙ 提交于 2019-12-07 07:22:27
Is there a way to convert a gray-scale image to a colour image? Here's a few JPG examples Photo 1 Photo 2 Photo 3 ImageMagick is powerful but doesn't seem capable of converting to a colourful version. Unfortunately this is not possible. Grayscale images do not contain sufficient information to create a color image. In instances where you see B&W/Grayscale images converted to color, this has been done manually in an application such as photoshop. You can use imagemagick to apply a filter but you cannot re-introduce color. http://www.imagemagick.org/Usage/color_mods/#level-colors You cannot

Get remote image using cURL then resample

我与影子孤独终老i 提交于 2019-12-07 02:55:04
问题 I want to be able to retrieve a remote image from a webserver, resample it, and then serve it up to the browser AND save it to a file. Here is what I have so far: $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "$rURL"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); // grab URL and pass it to the browser $out = curl_exec($ch); // close cURL resource, and free up system resources curl_close($ch); $imgRes =

Fading a picture gradually

荒凉一梦 提交于 2019-12-07 02:36:55
问题 The idea of this function is to fade the top half only of the picture (make it gradually darker). Here is what I have but it seems to be making all of the top half solid black. def fadeDownFromBlack(pic1): w=getWidth(pic1) h=getHeight(pic1) for y in range(0,h/2): for x in range(0,w): px=getPixel(pic1,x,y) setBlue(px,y*(2.0/h)) setRed(px,y*(2.0/h)) setGreen(px,y*(2.0/h)) 回答1: Let's look at just one line here: setBlue(px,y*(2.0/h)) and key part here is y*(2.0/h) y changes, as you go down. Let's

Image scaling does not work when original image height & width is smaller the scaling height & width

倖福魔咒の 提交于 2019-12-06 19:48:29
I have got a problem when trying to scale an image. The problem presents itself when the image i am trying to scale (original) is smaller than the size i am trying to scale up to. For example, an image with the width of 850px and the height of 700px trying to be scaled up to 950px width and height. The image seems to be scaled properly but is beeing drawn wrong on my bitmap. The code to scale the image will follow. The width beeing sent into ScaleToFitInside is the width and height trying to scale to, 950px both in my example. public static Image ScaleToFitInside(Image image, int width, int

Need PhotoBooth Mac feature in iphone app

吃可爱长大的小学妹 提交于 2019-12-06 17:32:13
问题 Have a look on following application http://itunes.apple.com/us/app/fatbooth/id372268904?mt=8 i think they are using the same feature provided my PhotoBooth MAC. Please suggest any api or any other possible solution so that I can build an iphone application Thanks 回答1: Core Image (certainly used by Photo Booth on the Mac) is not a public API on the iPhone. To achieve something similar, you would have to use OpenGL and write your own shaders (or do something like OpenGL mesh distortion). 来源:

Remove shapes from image with X number of pixels or less

百般思念 提交于 2019-12-06 14:45:27
If I have a image with, let's say squares. Is it possible to remove all shapes formed by 10 (non white) pixels or less and keep all shapes that is formed by 11 pixels or more? I want to do it programmatically or with a command line. Thanks in advance! Andrew Cash There are a couple of ways to approach this. What you are referring to is commonly called Despeckle in Document Imaging Applications. Document scanners often introduce a lot of dirt and noise into an image during scanning and so this must be removed removed to help improve OCR accuracy. I assume you are processing B/W images here or

PHP/JS - Create thumbnails on the fly or store as files

纵然是瞬间 提交于 2019-12-06 11:19:53
问题 For an image hosting web application: For my stored images, is it feasible to create thumbnails on the fly using PHP (or whatever), or should I save 1 or more different sized thumbnails to disk and just load those? Any help is appreciated. 回答1: Save thumbnails to disk. Image processing takes a lot of resources and, depending on the size of the image, might exceed the default allowed memory limit for php. It is less of a concern if you have your own server with only your application running