• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

Zombie

Change colors with greyscale ?

7 posts in this topic

I have to do a face editor. I need to give user the ability to change the skin color without touching the face itself. I expect I should do a greyscale image of face, then change the colors of picture in program. The function doesn''t need to be too fast, because the colors aren''t changed too fast. It''s going to be DirectDraw.
0

Share this post


Link to post
Share on other sites
I think I see what you''re getting at. You want to let the users change the color of individual pixels in the image without changing the overall appearance of the face.

I think you should look into a little about how colors are describe with HSB (Hue, Saturation and Brightness). Hue describes the the color as the location on a color wheel, where red is at zero degrees, green at 120 degrees and blue at 240. Saturation is the purity of the color, with 0% saturation you have a gray color. Brightness is of course how bright the color is with 0% for black and 100% for white.

By adjusting Hue and Saturation you can change the colors of the image without changing the appearance of the face which is coded in the brightness component.

(Did this make any sense )
0

Share this post


Link to post
Share on other sites
It did make sense, but when I tried to use DirectDrawColorControl.GetColorControls (and setColorControls), all I received was a grey screen. That didn''t make sense. So my problem is now, how to use those color things?
0

Share this post


Link to post
Share on other sites
DirectDrawColorControl is used to change the color of the entire surface or screen, most likely to set the gamma. You cannot use this to change individual pixels in your image.

You need to make a function that can convert between RGB and HSB and back. That way you can read the color of a pixel, convert it to HSB manipulate the components, convert it back to RGB and finally set the pixel.
0

Share this post


Link to post
Share on other sites
Most likely it''ll be too slow in VB. I''ve used PSet function in VB (no DX) and it takes many seconds to draw even a small area! Not good. It can be faster in DirectX, though. Do you know a site where can I find information of HSB, or perhaps the function?

0

Share this post


Link to post
Share on other sites
Since i am not a expert VB programmer i cant say so much about this, but if you could get a pointer to the surface, you could make the changes using scanlines. A scanline is a pointer that you give the address of the "Y" component and calculates the address in the memory of the position given. So you can copy the whole line of the picture to the RAM memory, make the changes on the memory and store it back on the surface you want(i think its the video, isnt it?). In C language i know how its done but not in VB.
You can try it, it's a lot faster.

Try to not use single pixel functions, its very slow.


Edited by - chronno on 2/20/00 12:00:28 PM

Edited by - chronno on 2/20/00 12:01:46 PM
0

Share this post


Link to post
Share on other sites
VB is not very fast because it is an interpreted language and DX doesn''t have any support for this.

You will probably have to make your own function in C and put it in a DLL so you can call it from VB.

I don''t know of any site where you can read about it, I read it in the Photoshop help file.
0

Share this post


Link to post
Share on other sites
Since you are using a ddcolorcontrol, I assume you are using dx. Just use directdrawsurface7.lock(), then either get the whole array data with ddsurf.getlockedarray, or check every pixel with ddsurf.getlockedpixel. Trust me, it works in VB because I use VB.

The reason PSet is so slow in small areas is that you are using TWIPS and not PIXELS. I don't care if you are using AutoRedraw, Twips is like 15 points per pixel. That is a lot of overdraw. If you are not using twips then, I don't know.

I hope what I replied is what you want. I'm no McDonalds.

Edited by - nes8bit on 2/21/00 2:50:01 AM
0

Share this post


Link to post
Share on other sites