Thursday, 15 May 2014

python - media.set_xx ValueError -


New man here. I asked about the program to hide a phantom a while ago, in which I was having trouble and got some good reactions. In fact, I tried to write a program that was given in a given folder in another given folder Change pixels to another color.

I believe I have this down, but now this program is telling me that I have an invalid value for the red component of my color (value: invalid red value is specified), Even if it is being changed from 64 to 56. Any help of this matter will be appreciated!

Import import import import import (old, new, folder)

(Here's the code, if I'm messing elsewhere; it's in Python):

  : Old_list = old split ('') new_list = new.split ('') folder_location = os.path.join ('C: \\', 'Users', 'Owner' for file name in Oslistdir (folder) , 'Spriting', folder): current_file = media.load_picture (folder_location + '\\' + Filename) for pix in current_file: if (media.get_red (pix) == int (old_list [0])) and \ ( Media.get_green (pix) == int (old_list [1]) and \ (media Get_blue (pix) == int (old_list [2])): media.set_read (pixels, newlists [0]) media.set_gree Media  name  == ' main ':  

  while 1: old = str (raw_input ('split the original RGB component by a single location, insert:')) if the old == 'left': Sys.exit (0) new = Str (raw_input) 'new' == 'quit': sys.exit (0) folder = str (raw_input ('Please enter the name of the folder, please enter the new RGB component, from one space Separate: ')) (old, new, folder)  

The speed is moving; But there is no worry, I did not convert the values ​​found in an integer, trying to use the strings as logic ...


No comments:

Post a Comment