NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 53 54 55 56 57 … 93 Next »
Changing colours of a bitmap/image?

 
  • 0 Vote(s) - 0 Average
Changing colours of a bitmap/image?
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#1
2006-07-11, 06:48 PM
I'm working on something which reads in simple jpg images (example, a black arrow on a white square background). For skinning purposes (and user options) I'd like to be able to change individual colours so, for instance, if the user wants a white arrow on a black background they can do that.

Is there a way that I can read a jpg in as an Image then tell the image to substitute every occurence of a pixel that is colour X with colour Y?

I know I could just draw something as simple as an arrow programatically and set the colours at that stage, but the images are a little more complex than that.

Cheers,
Brian
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#2
2006-07-11, 06:55 PM
I dont know of any ready to use function, but if speed is not a primary concern you could always work your way through each pixel with Image.GetPixel(). A faster version of the same can be done with LockBits().
Old Dog
Offline

Posting Freak

Posts: 1,083
Threads: 99
Joined: Jul 2005
#3
2006-07-11, 07:01 PM
You might be better off using an image format that incorporates a color lookup table such as gif or 8-bit png. Simply change the entries in the table and you have changed the colors on the screen.

Also, you could change all the colors similarly, maintaining the color scheme.
Learning new tricks!
Visit Plain Jane's Collection
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#4
2006-07-11, 07:07 PM
sub Wrote:I dont know of any ready to use function, but if speed is not a primary concern you could always work your way through each pixel with Image.GetPixel(). A faster version of the same can be done with LockBits().
Thanks. I'll look at those - it might work as I wouldn't be looking at high-speed / dynamic changes - more like during the plugin initialization stage.

Cheers,
Brian
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#5
2006-07-11, 07:12 PM
Old Dog Wrote:You might be better off using an image format that incorporates a color lookup table such as gif or 8-bit png.
OK - I had something in the back of my mind about this sort of method. I'll try sub's suggestion and see if it's quick enough otherwise I'd need to convert the jpg files though (about 50 of them). I don't suppose you know of a command-line tool that I could pass a source jpg to and get it to output a gif or png do you? Smile

Cheers,
Brian
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#6
2006-07-11, 10:19 PM
imagemagick

just google for it.
Fatman_do
Offline

Posting Freak

Posts: 3,482
Threads: 95
Joined: Nov 2005
#7
2006-07-11, 10:27 PM
reven Wrote:imagemagick

just google for it.

Wow, that looks like a handy little program. I have needed to change image types before in batches but have never stumbled upon this.

Here is the link for the lazy:p
http://www.imagemagick.org/script/index.php
Fatman_do
[SIZE="1"]
HTPC: AMD XP+2500, 512MB DDR (400) ~ Capture Device: Hauppage PVR-150
Storage: 30GB OS & Recording, 160GB Post Processing & Archive
Video Output: HD 32" TV via eVGA Geforce 6200le 256MB AGP DVI-HDMI cable out
Audio Output: Turtle Beach Riviera S/PDIF Optic Output (Digital pass thru only) to Home Theater Receiver[/SIZE]

[SIZE="2"]
Moderator | Tutorials | Community Skin | CommunitySkin-SVN[/SIZE]
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#8
2006-07-12, 02:54 PM
reven - thanks for the suggestion - it looks useful.

Fatman_do - thanks for the link
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Changing the recording priority on recurring recordings cbgifford 4 3,739 2014-08-17, 03:13 PM
Last Post: Kiwi
  Coverart / fanart image sizes??? bgowland 3 2,193 2014-02-16, 11:50 PM
Last Post: bgowland
  Where does this image come from? bgowland 4 2,344 2013-02-13, 07:26 PM
Last Post: bgowland
  Problem with preview image for Pending Recordings Northpole 2 1,968 2012-08-14, 02:56 AM
Last Post: Northpole
  FanArt & displaying a background image Jaggy 2 1,682 2012-01-31, 11:39 PM
Last Post: sub
  Changing recording schedules on the fly. mvallevand 2 1,875 2011-09-06, 03:30 AM
Last Post: BrettB
  A list of changing images McBainUK 1 1,828 2011-06-21, 04:36 PM
Last Post: sub
  Which channel logo image formats does npvr support? bgowland 2 2,043 2011-03-06, 05:43 AM
Last Post: bgowland
  Image Caching imilne 6 2,508 2011-01-01, 11:45 PM
Last Post: sub
  Changing skin font or colour mvallevand 30 6,830 2010-07-23, 02:20 PM
Last Post: whurlston

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode