Search Results

Search found 603 results on 25 pages for 'rgb'.

Page 17/25 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Qt 4.6 QLineEdit Style. How do I style the gray highlight border so it's rounded?

    - by krunk
    I'm styling a QLineEdit to have rounded borders for use as a search box. The rounding of the borders themselves were easy, but I can't figure out for the life of me how to round the highlighted portion of the widget when it has focus. I've tried QLineEdit::focus, but this only modifies the interior border. The images below show how the illusion of a rounded qlineedit is lost when it gains focus. QListView, QLineEdit { color: rgb(127, 0, 63); selection-color: white; border: 2px groove gray; border-radius: 10px; padding: 2px 4px; } Images with and without focus:

    Read the article

  • Kohonen SOM Maps: Normalizing the input with unknown range

    - by S.N
    According to "Introduction to Neural Networks with Java By Jeff Heaton", the input to the Kohonen neural network must be the values between -1 and 1. It is possible to normalize inputs where the range is known beforehand: For instance RGB (125, 125, 125) where the range is know as values 0 and 255: 1. Divide by 255: (125/255) = 0.49 (0.49,0.49,0.49) 2. Multiply by two and subtract one: ((0.49*2)-1)=-0.02 (-0.02,-0.02,-0.02) The question is how can we normalize the input where the range is unknown like our height or weight. Also, some other papers mention that the input must be normalized to the values between 0 and 1. Which is the proper way, "-1 and 1" or "0 and 1"?

    Read the article

  • Drawing RAW buffer to CGBitmapContext

    - by Raj
    Hi all, I have a raw image buffer in the RGB format. I need to draw it to CGContext so that I get a new buffer of the format ARGB. I accomplish this in the following way: Create a data provider out of raw buffer using CGDataProviderCreateWithData and then create image out of the data provider with the api: CGImageCreate. Now if I write this image back to the CGBitmapContext using CGContextImageDraw. Instead of creating an intermediate image, is there any way of writing the buffer directly to CGContext so that I can avoid the image creation phase? Thanks

    Read the article

  • NSScanner scanFloat returning unexpected results

    - by E-Madd
    I'm trying to build a UIColor from a comma-delimited list of values for RGB, which is "0.45,0.53,0.65", represented here by the colorConfig object... NSScanner *scanner = [NSScanner scannerWithString:colorConfig]; [scanner setCharactersToBeSkipped:[NSCharacterSet characterSetWithCharactersInString:@"\n, "]]; float red, green, blue; return [UIColor colorWithRed:[scanner scanFloat:&red] green:[scanner scanFloat:&green] blue:[scanner scanFloat:&blue] alpha:1]; But my color is always coming back as black. So I logged the values to my console and I'm seeing Red = -1.988804, Green = -1.988800, Blue = -1.988796 What am I doing wrong?

    Read the article

  • Code golf: the Mandelbrot set

    - by Stefano Borini
    Usual rules for the code golf. Here is an implementation in python as an example from PIL import Image im = Image.new("RGB", (300,300)) for i in xrange(300): print "i = ",i for j in xrange(300): x0 = float( 4.0*float(i-150)/300.0 -1.0) y0 = float( 4.0*float(j-150)/300.0 +0.0) x=0.0 y=0.0 iteration = 0 max_iteration = 1000 while (x*x + y*y <= 4.0 and iteration < max_iteration): xtemp = x*x - y*y + x0 y = 2.0*x*y+y0 x = xtemp iteration += 1 if iteration == max_iteration: value = 255 else: value = iteration*10 % 255 print value im.putpixel( (i,j), (value, value, value)) im.save("image.png", "PNG") The result should look like this Use of an image library is allowed. Alternatively, you can use ASCII art. This code does the same for i in xrange(40): line = [] for j in xrange(80): x0 = float( 4.0*float(i-20)/40.0 -1.0) y0 = float( 4.0*float(j-40)/80.0 +0.0) x=0.0 y=0.0 iteration = 0 max_iteration = 1000 while (x*x + y*y <= 4.0 and iteration < max_iteration): xtemp = x*x - y*y + x0 y = 2.0*x*y+y0 x = xtemp iteration += 1 if iteration == max_iteration: line.append(" ") else: line.append("*") print "".join(line) The result ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** **************************************** *************************************** **************************************** *************************************** **************************************** *************************************** **************************************** *************************************** **************************************** *************************************** **************************************** *************************************** **************************************** *************************************** *************************************** ************************************** ************************************* ************************************ ************************************ *********************************** *********************************** ********************************** ************************************ *********************************** ************************************* ************************************ *********************************** ********************************** ******************************** ******************************* **************************** *************************** ***************************** **************************** **************************** *************************** ************************ * * *********************** *********************** * * ********************** ******************** ******* ******* ******************* **************************** *************************** ****************************** ***************************** ***************************** * * * **************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ********************************************************************************

    Read the article

  • jQuery plugin: Colorpicker

    - by New Developper
    Hey all, I'm using this colorpicker (http://www.eyecon.ro/colorpicker) and am trying to capture the hex value so that I can use it on the server side to store the selected color. If you check out the link provided, I'm using the last option: $('#colorSelector').ColorPicker({ color: '#0000ff', onShow: function (colpkr) { $(colpkr).fadeIn(500); return false; }, onHide: function (colpkr) { $(colpkr).fadeOut(500); return false; }, onChange: function (hsb, hex, rgb) { $('#colorSelector div').css('backgroundColor', '#' + hex); } }); My problem is that I can't seem to get the hex value from it...I've tried simply calling the name of the input to get its value, but it won't work (when you click away to make the colorpicker disappear, the input changes to 'style="display:none;"' so I can't get anything from it. Then, I tried pulling the value using some simple jQuery calls, but got nothing... Please help....

    Read the article

  • Alternative to BitConverter.ToInt32

    - by MusiGenesis
    I'm using BitConverter.ToInt32 to pack 3 byte values into an int, like so: byte R = 0; byte G = 0; byte B = 0; int i = BitConverter.ToInt32(new byte[] { R, G, B, 0 }, 0); Is there a faster way to do this that doesn't involve the creation of a new int each time? Getting the bytes out of an int is easy: int i = 34234; byte B = (byte)(i >> 0); byte G = (byte)(i >> 8); byte R = (byte)(i >> 16); Is there a simple way to reverse this process and use bit-shifting to write the RGB bytes back over an existing int?

    Read the article

  • Masks and transparency

    - by Henrik
    Hi, I'm fairly new to Shoes and ran into two problems. First I want to set a mask using a partially transparent png, like this: mask do image "images/stencilMask.png" end Is this possible somehow or can only vector shapes be used? Apart from that, I noticed a small bug(?) when trying to set a transparent color as a stroke on any kind of text, like this: title "Hello", :stroke => rgb(1.0, 0.0, 0.0, 0.5) The transparency simply isn't applied. Am I doing anything wrong, or is this actually a bug? Cheers and thanks for all answers

    Read the article

  • How do I edit an interface builder object programmatically?

    - by Evelyn
    I created a label using Interface Builder, and now I want to set the background color of the label using code instead of IB's color picker. (I want to do this so that I can define the color using RGB and eventually change the colorspace for the label.) I'm in cocoa. How do I edit the attributes of an IB object using code? My code looks like this: //.h file #import <UIKit/UIKit.h> @interface IBAppDelegate : NSObject { UILabel *label; } @property (nonatomic, retain) IBOutlet UILabel *label; @end //.m file #import "IBAppDelegate.h" @implementation IBAppDelegate @synthesize label; (memory stuff...) @end

    Read the article

  • PIL saves image colour wrong

    - by Tom Viner
    I have an image. I want to resize it using PIL, but it come out like this. Even without a resize it still messes up the colour. Minimal code: from PIL import Image import os import urllib import webbrowser orig_url = 'http://mercedesclub.org.uk/images/stackoverflow-question/least-popular-colours-_-500-x-500.jpg' temp_fn, _ = urllib.urlretrieve(orig_url) im = Image.open(temp_fn) fn = os.tempnam() + '.jpg' im.save(fn) webbrowser.open(fn) I've tried Image.open(temp_fn).convert(format) with 'RGB', 'CMYK' and 'L' as formats, but still get weirdly coloured or grey results. When I load the image from my hard drive and I can see: >>>im.info {'adobe': 100, 'progression': 1, 'exif': 'Exif\x00\x00MM\x00*...\x7f\xff\xd9', 'adobe_transform': 100} >>>im.format 'JPEG' >>>im.mode 'CMYK' >>> im._getexif() {40961: 65535, 40962: 500, 40963: 500, 296: 2, 34665: 164, 274: 1, 305: 'Adobe Photoshop CS Macintosh', 306: '2010:02:26 12:46:54', 282: (300, 1), 283: (300, 1)} Thanks and let me know if you need any more data.

    Read the article

  • Looking for PCA snippet/source code in C++

    - by jihchuan
    Hi, I'm currently developing a software to compare 2 images. I start with extract the image's RGB values, form a matrix of array and then attempt to compress the values using PCA, and then match/recognize it with a pre-set data to find its similarity. But I can't proceed with the PCA part. (I'm using C++, C also can) If there any library/source code/snippet for it please let me know, or if there're any recommendation on my case also very welcomed!! I'd appreciate your helps!! Thanks! JC, [email protected]

    Read the article

  • How to work with BufferedImage and YCbCr colorspace?

    - by Onlyx
    Hi everyone! I need to translate colors in bitmap loaded to BufferedImage from RGB to YCbCr (luminance and 2 channels chrominance) and back after process. I made it with functions used like rgb2ycbcr() in main method for each pixel, but it isn't so smart solution. I should use ColorSpace and ColorModel classes to get BufferedImage with correct color space. It would be more flexible method, but I don't know how to do that. I'm lost and I need some tips. Can somebody help me?

    Read the article

  • How to colorize section headings in LaTeX like this?

    - by Nazgulled
    Hi, Accidently I created this nice colored effect on my LaTeX TOC: http://i43.tinypic.com/o5aptl.png Which I like and want to keep, I created this effect like this: \definecolor{Section1}{rgb}{0.09,0.21,0.36} \section{\color{Section1}Introdução} However, as you can see on the TOC sidebar, there was a nasty side effect. I tried to fix it like this: \section[Introdução]{\color{Section1}Introdução} But didn't work, the sidebar TOC was fixed but on the TOC list, the blue color was gone and was now red instead (default for clickable TOC heading links) I also tried: {\color{Section1}\section{Introdução}} But the effect was the same, fixed TOC but no color on the TOC list. Any suggestions?

    Read the article

  • exchanging 2 memory positions

    - by Jordi
    I am working with OpenCV and Qt, Opencv use BGR while Qt uses RGB , so I have to swap those 2 bytes for very big images. There is a better way of doing the following? I can not think of anything faster but looks so simple and lame... int width = iplImage->width; int height = iplImage->height; uchar *iplImagePtr = (uchar *) iplImage->imageData; uchar buf; int limit = height * width; for (int y = 0; y < limit; ++y) { buf = iplImagePtr[2]; iplImagePtr[2] = iplImagePtr[0]; iplImagePtr[0] = buf; iplImagePtr += 3; } QImage img((uchar *) iplImage->imageData, width, height, QImage::Format_RGB888);

    Read the article

  • Getting Windows XP colours in .NET

    - by LauraM
    I am trying to get a specific colour used by Windows XP in my .NET application. In Windows XP, if you go the Control Panel in 'category view', on the left hand side you have some 'See Also' options (Windows Update, Help and Support, Other Control Panel Options). The colour I'm trying to get is the light blue background colour shown behind these options. I don't need the hex/RGB value of the colour, as it can change depending on the style settings used on the desktop. My question is - is it possible to programmatically get hold of this colour in a .NET app? The colour doesn't appear to be in SystemColors, although it's very similar to SystemColors.InactiveCaptionText (and I think I can probably get away with using this). I'm just wondering if there is a way to get hold of the exact colour.

    Read the article

  • Find the closest vector

    - by Alexey Lebedev
    Hello! Recently I wrote the algorithm to quantize an RGB image. Every pixel is represented by an (R,G,B) vector, and quantization codebook is a couple of 3-dimensional vectors. Every pixel of the image needs to be mapped to (say, "replaced by") the codebook pixel closest in terms of euclidean distance (more exactly, squared euclidean). I did it as follows: class EuclideanMetric(DistanceMetric): def __call__(self, x, y): d = x - y return sqrt(sum(d * d, -1)) class Quantizer(object): def __init__(self, codebook, distanceMetric = EuclideanMetric()): self._codebook = codebook self._distMetric = distanceMetric def quantize(self, imageArray): quantizedRaster = zeros(imageArray.shape) X = quantizedRaster.shape[0] Y = quantizedRaster.shape[1] for i in xrange(0, X): print i for j in xrange(0, Y): dist = self._distMetric(imageArray[i,j], self._codebook) code = argmin(dist) quantizedRaster[i,j] = self._codebook[code] return quantizedRaster ...and it works awfully, almost 800 seconds on my Pentium Core Duo 2.2 GHz, 4 Gigs of memory and an image of 2600*2700 pixels:( Is there a way to somewhat optimize this? Maybe the other algorithm or some Python-specific optimizations.

    Read the article

  • can't get rid of top and bottom drop shadows

    - by Jawad
    Why with the following code, I still can't get rid of drop shadows at the top and bottom. Although the drop shadows are "small", yet still they are there. div#inner_container { width: 960px; margin: 0px auto; background-color: rgb(255, 255, 255); box-shadow: 0 9px 0px 0px transparent, 0 -9px 0px 0px transparent, 12px 0 15px -4px rgba(255, 255, 255, 0.5), -12px 0 15px -4px rgba(255, 255, 255, 0.5); position: relative; z-index: 5000; }

    Read the article

  • jQuery - color cycle animation with hsv colorspace?

    - by Sgt. Floyd Pepper
    Hi there, I am working on a project, which I need a special body-background for. The background-color should cycle through the color spectrum like a mood light. So I found this: http://buildinternet.com/2009/09/its-a-rainbow-color-changing-text-and-backgrounds/ "But" this snippet is working with the RGB colorspace which has some very light and dark colors in it. Getting just bright colors will only work with the HSV colorspace (e.g. having S and V static at 100 and letting H cycle). I don’t know how to convert and in fact how to pimp this snippet for my needs. Does anyone has an idea?? Thanks in advance. Best, Floyd

    Read the article

  • Fade a color to white (increasing brightness)

    - by Jon B
    I want to make a text box in .NET "glow" yellow, and then "fade" to white (basically, by incrementally increasing the brightness). I think Stackoverflow does this after you've posted an answer. I know that increasing brightness is not all that simple (it's not just uniformly increasing/decreasing RGB), but I'm not sure how to do this. Perfect color accuracy is not important for this. I am using C#, although VB examples would be just fine, too. Edit: This is for Winforms.

    Read the article

  • Copying a 14bit grayscale image (saved in long[]) to a pictureBox

    - by Itsik
    My camera gives me 14bit grayscale images, but the API's function returns a long* to the image data. (so i'm assuming 4 bytes for each pixel) My application is written in C++/CLI, and the pictureBox is of .NET type. I am currently using the BitmapData.LockBits() mechanism to gain pointer access to the image data, and using memcpy(bmpData.Scan0.ToPointer(), imageData, sizeof(long)*height*width) to copy the image data to the Bitmap. For now, the only PixelFormat that is working is 32bit RGB, and the image appears in shades of blue with contours. Trying to initialize the Bitmap as 16bppGrayscale isn't working. I would ideally want to cast the array from long to word and using a 16bit format (hoping the the 14bit data will be displayed properly) but I'm not sure if this works. Also, I don't want to iterate over the image data, so finding the min/max and then histogram stretching to [0..255] isnt an option for me (the display must be as efficient as possible) Thanks

    Read the article

  • Java Convert ColorSpace of BufferedImage to CS_GRAY without using ConvertColorOp

    - by gmatt
    I know its possible to convert an image to CS_GRAY using public static BufferedImage getGrayBufferedImage(BufferedImage image) { BufferedImageOp op = new ColorConvertOp(ColorSpace .getInstance(ColorSpace.CS_GRAY), null); BufferedImage sourceImgGray = op.filter(image, null); return sourceImgGray; } however, this is a chokepoint of my entire program. I need to do this often, on 800x600 pixel images and takes about 200-300ms for this operation to complete, on average. I know I can do this alot faster by using one for loop to loop through the image data and set it right away. The code above on the other hand constructs a brand new 800x600 BufferedImage that is gray scale. I would rather just transform the image I pass in. Does any one know how to do this with a for loop and given that the image is RGB color space?

    Read the article

  • Masking to Transparent returns empty image

    - by Tibi
    Hi there, I'm trying to put white color in my images to transparent with the following code. Problem is that "CGImageRef maskedTransparent" is blank. I don't understand because the code I'm using is nearly a copy paste from the doc ... Any idea ? (UIImage*) maskImage:(UIImage *)image withMask:(UIImage *)maskImage { CGImageRef maskRef = maskImage.CGImage; CGImageRef mask = CGImageMaskCreate(CGImageGetWidth(maskRef), CGImageGetHeight(maskRef), CGImageGetBitsPerComponent(maskRef), CGImageGetBitsPerPixel(maskRef), CGImageGetBytesPerRow(maskRef), CGImageGetDataProvider(maskRef), NULL, false); CGImageRef masked = CGImageCreateWithMask([image CGImage], mask); //Array defining min & max RGB values to be transformed to transparent colors. float maskingMinMax[6] = {255, 255, 255, 255, 255, 255}; //masking image to remove range in maskinLinMax CGImageRef maskedTransparent = CGImageCreateWithMaskingColors(masked, maskingMinMax); return [UIImage imageWithCGImage:maskedTransparent]; }

    Read the article

  • Improving the efficiency of Kinect for Windows DTWGestureRecognition Application

    - by Ray
    Currently I am using the DTWGestureRecognition open source tool for Kinect SDK v1.5. I have recorded a few gestures and use them to navigate through Windows 7. I also have implemented voice control for simple things such as opening PowerPoint, Chrome, etc. My main issue is that the application uses quite a bit of my CPU power which causes it to become slow. During gestures and voice commands, the CPU usage sometimes spikes to 80-90%, which causes the application to be unresponsive for a few seconds. I am running it on a 64 bit Windows 7 machine with an i5 processor and 8 GB of RAM. I was wondering if anyone with any experience using this tool or Kinect in general has made it more efficient and less performance hogging. Right now I removed sections which display the RGB video and the Depth video but even doing that did not make a big impact. Any help is appreciated, thanks!

    Read the article

  • Why does Color.IsNamedColor not work when I create a color using Color.FromArgb()?

    - by Jon B
    In my app I allow the user to build a color, and then show him the name or value of the color later on. If the user picks red (full red, not red-ish), I want to show him "red". If he picks some strange color, then the hex value would be just fine. Here's sample code that demonstrates the problem: static string GetName(int r, int g, int b) { Color c = Color.FromArgb(r, g, b); // Note that specifying a = 255 doesn't make a difference if (c.IsNamedColor) { return c.Name; } else { // return hex value } } Even with very obvious colors like red IsNamedColor never returns true. Looking at the ARGB values for my color and Color.Red, I see no difference. However, calling Color.Red.GetHashCode() returns a different hash code than Color.FromArgb(255, 0, 0).GetHashCode(). How can I create a color using user specified RGB values and have the Name property come out right?

    Read the article

  • Safari does not show images, but FireFox does

    - by Elliot
    I have a website that I am working on: http://keramed.com in FireFox on my Mac the image on the main page shows up. (The Endoshield DSEK Graft Injector) Now check in Safari and the image does not show up. I have tried taking the original .PSD and saving it as a .jpg or .png and it does not matter. I have commented out all stylesheets and this still does not solve it. The rest of my images are showing up, just not thing one. I just dont understand I am stumped. EDIT: Photoshop says it is an RGB 8-bit image.

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >