image-manipulation

Need help understanding the ImageMagick/Graphicsmagick -colors option

孤街浪徒 提交于 2019-12-23 04:22:15
问题 I am trying to programmatically reduce (lossy) the file size of PNG and GIF files. As part of this I need to reduce the number of colors in the images. I don't want to reduce all the images to a single colors value, so what I am doing is; get the number of unique colors in the image, then; divide this number by 2 to reduce the number of colors by half. The problem is this does not work. Using ImageMagic it is way too slow and doesn't reduce the file size unless the image has under a few

How do I rotate an image on the iPhone?

眉间皱痕 提交于 2019-12-23 04:11:51
问题 How do I rotate an image in iPhone programming? 回答1: A great rotation and image UIImage category by Allen Brunson can be found here: http://www.platinumball.net/blog/2010/01/31/iphone-uiimage-rotation-and-scaling/ 回答2: image.transform = CGAffineTransformMakeRotation(3.142); rotates it 180 degrees. 回答3: You can rotate a view using a CCGAffineTransform. You can create a rotation matrix by specifying the degrees in radians you want to rotate, then setting the rotation matrix to be the .transform

Overlay text over an image background and convert to PDF

微笑、不失礼 提交于 2019-12-23 03:47:17
问题 Using .NET, I want to programmatically create a PDF which simply consists of a background image with two labels over it with different fonts and positioning. I have read about existing PDF libraries, but don't know (if applicable) which one is the easiest for such a simple task. Anyone care to guide me? P.D.: I do not want to create the PDF with a generated image that already overlays the text over the background image. Edit: This is the final working code: public string Create() { if (

C# - Finding the Boundaries of an Image (not the size)

独自空忆成欢 提交于 2019-12-23 03:19:10
问题 I'm developing an application to split an image grid equally and center the images (based on their similarity). So far, I could manage to fix a grid of images with small sizes, but whenever I try a larger "sprite" size (100x100, for instance), I get Stack Overflow error. Yes I'm using recursion, but whenever a pixel is checked, I set a boolean to deactivate it, copy it to a list and go on checking the others (in all directions), until the list is filled up with an image from the grid. I'm not

How to use ImageMagick to batch desaturate images?

旧时模样 提交于 2019-12-23 02:41:21
问题 I have an image that is black text with some gray and pale yellowish background. I basically want to keep the text as black as possible, and make the gray and yellow comparatively lighter...at the very least, turn yellow into a light gray. What's the most efficient way to do that in ImageMagick? 回答1: Answering the title question: you can batch desaturate images with the options -colorspace Gray OR -type Grayscale OR -modulate 100,0 - reference here: the options don't work identically Sample

Android Scale a bitmap image

瘦欲@ 提交于 2019-12-23 02:26:48
问题 My application has 9 bitmap images on it in a 3x3 grid. All of them are showing on the screen and depending on how the user interacts with them (tap, double tap, pinch, zoom, drag) the image that is "action-ed on" needs to perform different tasks. So for example, if I tap on one image, it needs to rotate around the it's vertical access completely, then stop. Currently i'm using SurfaceView with the onTouchEvent(..) method. The way I figured I could animate this is by scaling the image's width

jqzoom on multiple images

走远了吗. 提交于 2019-12-23 01:41:58
问题 I have the standard setup of one main image and multiple thumbnails which can be cliced to change the main image. I'm using jqzoom on the main image but was having the common problem of the main image changing and the zoomed image just going blank. Looking through stack overflow i found some code that claimed to correct this, and in a way it does. But rather than allow each changed image to have a zoom, it makes the main image just a link to the large version, bypassing the jqzoom function

Rotating part of an image in 3D space

笑着哭i 提交于 2019-12-22 13:49:29
问题 Here's the setup: This is for an ecommerce art site where some paintings are canvas transfers. The painting wraps around the sides and top and bottom of the canvas. We have high-res images of the entire painting, but what we want to display is a quasi-3D representation of the image in which you can see how the sides of the painting wrap around the canvas. Here's a rough sketch of what I'm talking about: My question is, how can I rotate an image in 3D space? The approach I think I'd like to

Use exiv2 or imagemagick to remove EXIF data from stdin and output to stdout

淺唱寂寞╮ 提交于 2019-12-22 12:22:33
问题 How can I pipe an image into exiv2 or imagemagick, strip the EXIF tag, and pipe it out to stdout for more manipulation? I'm hoping for something like: exiv2 rm - - | md5sum which would output an image supplied via stdin and calcualte its md5sum. Alternatively, is there a faster way to do this? 回答1: Using exiv2 I was not able to find a way to get exiv2 to output to stdout -- it only wants to overwrite the existing file. You could use a small bash script to make a temporary file and get the md5

javascript preloading images - check whether an image is cached/loaded to prevent preload

廉价感情. 提交于 2019-12-22 06:47:00
问题 I have a few doubts which i am already sure of it but still want to be very precise about it. If this is a duplicate question then please give me links so that i will delete this question and will refer the provided links I need to preload few images. I dont want to preload if they already exists in the browser cache. if we are preloading then we use the javascript code to preload which sends a request. also we have an img src for the same image in the html document. will the browser request