image-manipulation

Better image coloring logic/algorithm

青春壹個敷衍的年華 提交于 2019-11-30 09:23:13
I am developing an iOS app in which the user can change a part of an image's color, say a Tea Cup, by touching it. I am using Floodfill algorithm to fill colors so that the user has to tap on the Tea Cup to change its color. That's working fine. But, the final color looks little different than the replacement color. I have some problem finding out a better logic to convert the object's(Tea Cup) color to the selected color considering its saturation & lightness. I am using the following logic to get the result color. I am representing color as (hue, saturation, value) . touchedColor = (tchd_h,

JS/jQuery Image Editor

南笙酒味 提交于 2019-11-30 09:03:35
has anyone stumbled upon image editor done either in pure JS, or jQuery - that kind like CKEditor has? I'm looking for piece of code, that adds handles to image, so you can resize it, or even drag image around, as you wish. Thank you. Edit: rephrased . Anonymous Here is wonderful image crop/resize JQuery plugin http://www.cropzoom.com.ar/ Yes there are numerous online. Find here . jCrop is exceptional and awesome. The way editors such as tinyMCE and CKEditor do it is like this <div contenteditable="true" id="div1"> <img src="tache17.jpg" /> </div> <a href="javascript:alert(document

Remove white background from an image

淺唱寂寞╮ 提交于 2019-11-30 08:57:25
I want to get a transparent background or no background for my images. I tried the '-background none' option and also the 'transparent' option, but the background image remains white. How can I achieve this? Please suggest. Ali If you are using Imagemagik then the command is: convert input.gif -transparent white output.gif However it will only work with a pure white background and not a shade of white. There are alternative and easier ways to do this with IrfanView or The Gimp or Photoshop (more on that below). This article mentions that you may be using convert.exe that comes with Windows

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

人盡茶涼 提交于 2019-11-30 08:15:38
问题 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? 回答1: 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

How to replace color of an image?

微笑、不失礼 提交于 2019-11-30 07:23:58
I want to replace color of an image. For example turn all blue colors to red without any distortion on shape. When i try this i can swap the colors by iterating every pixel, however the shape of the swapped area turns into a flat shape. example1 input : http://www.tutorialwiz.com/tutorials/changing_color/images/original.jpg example1 output: http://www.tutorialwiz.com/tutorials/changing_color/images/3.jpg example2: input output together : http://www.digital-photography-school.com/wp-content/uploads/2009/07/before-after.jpg The usual way to do this is to use an RGBImageFilter . See the docs for

How to proportional resize image of any type in .NET?

房东的猫 提交于 2019-11-30 06:27:31
问题 Is possible to resize image proportionally in a way independent of the image type (bmp, jpg, png, etc)? I have this code and know that something is missing (but don't know what): public bool ResizeImage(string fileName, string imgFileName, ImageFormat format, int width, int height) { try { using (Image img = Image.FromFile(fileName)) { Image thumbNail = new Bitmap(width, height, img.PixelFormat); Graphics g = Graphics.FromImage(thumbNail); g.CompositingQuality = CompositingQuality.HighQuality

Cross-browser way to flip html/image via Javascript/CSS?

巧了我就是萌 提交于 2019-11-30 06:08:19
问题 Is there a library/simple way to flip an image? Flip image like this: AABBCC CCBBAA AABBCC -> CCBBAA I'm not looking for animations , just flip the image. I've googled to no avial and only found a complex version that utilized SVG on MozillaZine which I'm not confident that it'll work cross-browser. 回答1: The following CSS will work in IE and modern browsers that support CSS transforms. I included a vertical flip class just in case you might want to use it too. .flip-horizontal { -moz

XSLT: Obtaining or matching hashes for base64 encoded data

大城市里の小女人 提交于 2019-11-30 05:50:28
I need to find a way to find a way to find the hash for the base64 encoded data in the XML node //note/resource/data , or somehow otherwise match it to the hash value in the node //note/content/en-note//en-media@hash See below for the full XML file Please suggest a way to {obtain|match} using XSLT 4aaafc3e14314027bb1d89cf7d59a06c {from|with} R0lGODlhEAAQAPMAMcDAwP/crv/erbigfVdLOyslHQAAAAECAwECAwECAwECAwECAwECAwECAwEC AwECAyH/C01TT0ZGSUNFOS4wGAAAAAxtc09QTVNPRkZJQ0U5LjAHgfNAGQAh/wtNU09GRklDRTku MBUAAAAJcEhZcwAACxMAAAsTAQCanBgAIf8LTVNPRkZJQ0U5LjATAAAAB3RJTUUH1AkWBTYSQXe8 fQAh

Making a color completely transparent in OpenCV

时间秒杀一切 提交于 2019-11-30 05:47:57
I have a basic png file with two colors in it, green and magenta. What I'm looking to do is to take all the magenta pixels and make them transparent so that I can merge the image into another image. An example would be if I have an image file of a 2D character on a magenta background. I would remove all the magenta in the background so that it's transparent. From there I would just take the image of the character and add it as a layer in another image so it looks like the character has been placed in an environment. Thanks in advance. That's the code i would use, First, load your image :

Image Manipulation Filter like white Balance, Exposure, split Tone etc on IOS

风流意气都作罢 提交于 2019-11-30 05:24:34
I have been trying since one week to achieve some image manipulation filters like WHITE BALANCE, EXPOSURE and SPLIT TONING (as in Photoshop) for my IOS app, but I didn't get a standard implementation to achieve any of them. I found the shell scripts to achieve them through ImageMagick but don't know how to change these scripts to its equivalent in C or objective C. I simply uses some convert command to do the magic things. Thanks in advance. Please Help. White Balance is achievable through changing temperature and tint of the image also. so if someone out there knows how to manipulate these