image-manipulation

How to stretch images with no antialiasing

£可爱£侵袭症+ 提交于 2019-12-17 04:31:01
问题 So I ran across this recently: http://www.nicalis.com/ And I was curious: Is there a way to do this sort of thing with smaller images? I mean, it's pixel art, and rather than using an image with each pixel quadrupled in size couldn't we stretch them with the code? So I started trying to make it happen. I tried CSS, Javascript, and even HTML, none of which worked. They all blur up really badly (like this: http://jsfiddle.net/nUVJt/2/), which brings me to my question: Can you stretch an image

How to manipulate images at the pixel level in C#

隐身守侯 提交于 2019-12-17 03:35:33
问题 How do I manipulate images at the pixel level in C#? I need to be able to read/modify each bitmap pixel RGB values separately. A code sample would be appreciated. 回答1: If you want speed, then LockBits. See here for a good walkthrough by Bob Powell . If you just want to edit a few, then GetPixel/SetPixel should do what you want. 回答2: A sample code routine (I use this for simple merge and compare functionality. It takes two images and produces a third greyscale image showing the differences

Bad image quality after resizing/scaling bitmap

旧巷老猫 提交于 2019-12-16 23:40:11
问题 I'm writing a card game and need my cards to be different sizes in different circumstances. I am storing my images as bitmaps so that they can be quickly drawn and redrawn (for animation). My problem is that no matter how I try and scale my images (whether through a matrix.postScale, a matrix.preScale, or a createScaledBitmap function) they always come out pixelated and blurry. I know that its the scaling thats causing the problem because the images look perfect when drawn without resizing. I

High Quality Image Scaling Library [closed]

只愿长相守 提交于 2019-12-16 20:04:27
问题 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 5 years ago . I want to scale an image in C# with quality level as good as Photoshop does. Is there any C# image processing library available to do this thing? 回答1: Here's a nicely commented Image Manipulation helper class that you can look at and use. I wrote it as an example of how to perform certain image manipulation

Split an image into 64x64 chunks

℡╲_俬逩灬. 提交于 2019-12-14 02:18:29
问题 I'm just wondering how I would go about splitting a pixel array (R,G,B,A,R,G,B,A,R,G,B,A,etc.) into 64x64 chunks. I've tried several methods myself but they all seem really over-complex and a bit too messy. I have the following variables (obviously filled with information): int nWidth, nHeight; unsigned char *pImage; And basically for each chunk I want to call: void ProcessChunk(int x, int y, int width, int height) You may be wondering why there is a width and height argument for the

Save OpenGL screen pixels to PNG using libpng

别说谁变了你拦得住时间么 提交于 2019-12-14 00:20:12
问题 I've been using SOIL to save images as BMP, but it turns out that SOIL (or stbi to be more specific) saves ~5MB images (which is about 1366x768 resolution image or more) which is quite insane. Original BMP saving code ( NOTE Everything is done in the render function): uint8_t *pixels = new uint8_t[w * h * 3]; // copy pixels from screen glBindTexture(GL_TEXTURE_2D, screenTex); glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, w, h); glPixelStorei(GL_PACK_ALIGNMENT, 1); glReadPixels(0, 0, w, h,

How to combine several JPEGs into a bigger JPEG in a lossless way programmaticaly (.net)

旧城冷巷雨未停 提交于 2019-12-13 16:24:53
问题 I have several JPEG images and I want to combine them into one big JPEG image. I can do that by creating a Bitmap and then combining them there but that way if I save it again as JPEG the image will deteriorate. So, is there any method that I can use to do that without losing quality while decoding/encoding? In ACDSee program I saw an option to rotate JPEGs without quality loss, so there might be a way to combine several images without losing quality. thanks 回答1: According to Wikipedia/Jpeg

How to render tilted images in Java?

天大地大妈咪最大 提交于 2019-12-13 16:17:50
问题 My problem is I have a Java application that renders an image. Now I want to render a tilted image. One straightforward approach would be to have a tilted image and then render it, but my aim is to tilt the image according to the mouse movement in the window. One possible solution for this would be to have multiple images at various tilted angles and render them as the mouse moves, but such an implementation is limited in precision and not quite the thing I want. Is there a way to render the

Opencv and python for auto cropping

二次信任 提交于 2019-12-13 15:52:38
问题 I want to crop images automatically. I am using ImageMagick for this . Command i am using convert 3.jpg -fuzz 10% -trim trim.jpg How do i fix this . I think there is problem with fuzz factor which am setting . 回答1: If you want to do this with OpenCV, a good starting point may be after doing some simple processing to remove noise and small details in the image, you can find the edges of the image and then find the bounding box and crop to that area. But in case of your second image, you may

Android ImageView NullPointerException

谁都会走 提交于 2019-12-13 13:27:08
问题 I have two images, a red light and a green light. I have a custom ListView that I would like to display a red light when a list item is inactive, and a green light when it is active. A list item is activated when it is pressed. Here is my code row.xml <ImageView android:id="@+id/iconLight" android:src="@drawable/light_off" android:layout_width="wrap_content" android:layout_height="wrap_content"/> main.java ImageView iconLight = (ImageView)findViewById(R.id.iconLight); iconLight