Saturday, November 20, 2010

How to change pictures to grayscale, sepia, and negate in dr. java programming?

how to change pictures in those three ways using dr, java programming, using for, foreach, or while loop? the other ones from other websites have nothing to do with dr. java and are far more complicated. anyone know a simple way using those 3 ways?How to change pictures to grayscale, sepia, and negate in dr. java programming?
Anyone who reads that is probably wondering what is ';dr'; or ';using dr'; and so am i!



For grayscale conversion, i.e black=0, white=255 and all values in between represent a shade of grey, you can do an average:



gray_val = ( pixelObj.getRed() + pixelObj.getGreen() + pixelObj.getBlue() ) / 3;



Another way is to use a weighted average:



gray_val = 0.3*pixelObj.getRed() + 0.6*pixelObj.getGreen() + 0.1*pixelObj.getBlue();



Once you get that value assign it to your pixel:

pixelObj.setGreen(gray_val);

pixelObj.setRed(gray_val);

pixelObj.setBlue(gray_val);



PS. I am assuming that pixelObj is an individual pixel element, if not, you'll have to find out how to access it and apply the above method.How to change pictures to grayscale, sepia, and negate in dr. java programming?
After spending hours researching this, I finally figured it out. I wrote a function that produces amazing sepia images. I posted the code on Sun's website:



http://forums.sun.com/thread.jspa?threadID=5394659

Report Abuse

How to make pictures change automatically using HTML for my website?

Hey, I want to be able to have 4 pictures on my website and type HTML code so that every 3 seconds the picture changes, how do I do that? Thanks!How to make pictures change automatically using HTML for my website?
you can do this using animated gif but the easy way is to us


java script this is the code:





%26lt;script language=';JavaScript1.2';%26gt;





var slideshow_width='200px' //SET IMAGE WIDTH


var slideshow_height='350px' //SET IMAGE HEIGHT


var pause=3000 //SET PAUSE BETWEEN SLIDE (3000=3 seconds)





var fadeimages=new Array()


//add yor images here add as you want by increasing the


//array like fadeimages[3]=www.yoursite.com/x.jpg


fadeimages[0]=';image1.jpg';


fadeimages[1]=';image2.jpg';


fadeimages[2]=';image3.jpg';





////NO need to edit beyond here/////////////





var preloadedimages=new Array()


for (p=0;p%26lt;fadeimages.length;p++){


preloadedimages[p]=new Image()


preloadedimages[p].src=fadeimages[p]


}





var ie4=document.all


var dom=document.getElementById





if (ie4||dom)


document.write('%26lt;div style=';position:relative;width:'+slidesh鈥? id=';canvas0'; style=';position:absolute;width:'+slidesh鈥?id=';canvas1'; style=';position:absolute;width:'+slidesh鈥?br>

else


document.write('%26lt;img name=';defaultslide'; src=';'+fadeimages[0]+'';%26gt;')





var curpos=10


var degree=10


var curcanvas=';canvas0';


var curimageindex=0


var nextimageindex=1








function fadepic(){


if (curpos%26lt;100){


curpos+=10


if (tempobj.filters)


tempobj.filters.alpha.opacity=curpos


else if (tempobj.style.MozOpacity)


tempobj.style.MozOpacity=curpos/100


}


else{


clearInterval(dropslide)


nextcanvas=(curcanvas==';canvas0';)? ';canvas0'; : ';canvas1';


tempobj=ie4? eval(';document.all.';+nextcanvas) : document.getElementById(nextcanvas)


tempobj.innerHTML='%26lt;img src=';'+fadeimages[nextimageindex]+'';%26gt;'


nextimageindex=(nextimageindex%26lt;fadeima鈥?nextimageindex+1 : 0


setTimeout(';rotateimage()';,pause)


}


}





function rotateimage(){


if (ie4||dom){


resetit(curcanvas)


var crossobj=tempobj=ie4? eval(';document.all.';+curcanvas) : document.getElementById(curcanvas)


crossobj.style.zIndex++


var temp='setInterval(';fadepic()';,50)'


dropslide=eval(temp)


curcanvas=(curcanvas==';canvas0';)? ';canvas1'; : ';canvas0';


}


else


document.images.defaultslide.src=fadei鈥?br>

curimageindex=(curimageindex%26lt;fadeimage鈥?curimageindex+1 : 0


}





function resetit(what){


curpos=10


var crossobj=ie4? eval(';document.all.';+what) : document.getElementById(what)


if (crossobj.filters)


crossobj.filters.alpha.opacity=curpos


else if (crossobj.style.MozOpacity)


crossobj.style.MozOpacity=curpos/100


}





function startit(){


var crossobj=ie4? eval(';document.all.';+curcanvas) : document.getElementById(curcanvas)


crossobj.innerHTML='%26lt;img src=';'+fadeimages[curimageindex]+'';%26gt;'


rotateimage()


}





if (ie4||dom)


window.onload=startit


else


setInterval(';rotateimage()';,pause)





%26lt;/script%26gt;How to make pictures change automatically using HTML for my website?
HTML can't do this. You need JavaScript or something else more powerful.
Well you can download a free trial of an animation program such as Animation Shop 3, which you might be able to find on download.com. You'll then have to animate your self and save it as a .gif


Or


You can create an album on photobucket.com and make 4 slide shows and it will give you an HTML code for it.

On animation shop 2, How do you make the pictures change slower?

Iv just downloaded animation shop 2 and i already kind of knew how to do it but iv added 3 pictures onto a storyboard and when i press play the pictures change too fast so you cant see the picture very well. How do i make the pictures change slower?On animation shop 2, How do you make the pictures change slower?
I use Animation Shop 3...I believe that the interface is similar. Try: Edit -%26gt; Select All and Animation -%26gt; Frame Properties -%26gt; Display Time...set it to about 100.



If that doesn't work for you, go to Animation Shop 2's help file and search for 'display time'.



Hope this helps :)On animation shop 2, How do you make the pictures change slower?
Never used this prog in my life, but i would look for the word ''duration'' somewhere and decrease this number or gain control of it in the first place.
  • act around males
  • web proxy server
  • How to change pictures to .png ?

    i saved a picture as a png image but it still looks like a JPEG...

    can you please tell me how to change JPEG to PNG =[How to change pictures to .png ?
    use photoshop to change the format ,

    save as file and select from the drop down list pngHow to change pictures to .png ?
    if you saved it as a .png then it is a .png
    Go to google and type

    Image converter
    Open the folder where the file is, then right click and say ';rename'; and keep the same name but put .png at the end and it will automatically change it. The picture itself may still look like a JPEG though because it might have lost some quality when you originally saved it as a JPEG. Hope this helps.

    How do I change picture settings on Sony Alpha 100?

    When I download my pictures from my sony alpha 100. I notice they are only at 72 dpi. Is there a way to change the settings on the camera on the way my pictures are saved on the memory card to 300dpi?How do I change picture settings on Sony Alpha 100?
    You can not control the pixels per inch in your camera, as this is a function of the sensor. I have found the following ppi for SOME cameras by the following manufacturers. I wonder if this specification is available anywhere. I have four camera manuals in front of me and I can't find it in any of them.



    NIKON - 300 ppi

    CANON - 180 ppi

    PENTAX - 72 ppi



    We ';discussed'; this by way of question and answers a while back and decided that the ppi file produced by the camera really did not have any effect on the capability to produce a good print. If I take a photo with my wife's 6 MP Nikon and view the image on the screen, it will start out as 300 ppi. If it's a full frame image of 3008 pixels x 2000 pixels, the SCREEN image would be pretty big if I viewed it full sized, but it would print 10.0'; x 6.6';. If you crop a 5x7 out of this, keeping it as full-frame as possible, it becomes 400 dpi.



    With my brother's 6 MP Pentax, the image is 2816 px x 2112 px, but it's at 72 ppi. If you print this without cropping, it would be 39'; x 29';!!! If you crop a 5x7 out of this, though, it becomes 402 dpi resolution, which is virtually identical for the Nikon 6 MP camera.



    With my son's 6 MP Canon Powershot A620, the image is 3072 px x 2304 px, but it's at 180 ppi. If you could possibly print this without cropping, it would be 17.1'; x 12.8';. If you crop a 5x7 out of this, though, it becomes 439 dpi resolution, which is a bit better than either of the other 6 MP cameras.



    In other words, regardless of the sensor's pixel-per-inch output, 6 MP cameras produced the same resolution when it came time to print comparable images. How about a camera with more pixels?



    If I take a photo with my 10 MP Nikon D200 and view the image on the screen, it will start out as 300 ppi. If it's a full frame image of 3872 pixels x 2592 pixels, the SCREEN image would be pretty big if I viewed it full sized, but it would print 12.9'; x 8.6';, if I had the right paper. If you crop a 5x7 out of this, keeping it as full-frame as possible, it becomes 516 dpi, or higher resolution than the 6 MP cameras. We knew that is would work out like this, though, didn't we?



    The REAL question is, what difference does this make in the real world? If we agree that 300 dpi is an excellent resolution for prints, as long as you end up with at least 300 ppi after you are done cropping on the screen, you will get an excellent print as far as resolution goes. All four cameras exceed that amount. I usually resize ';down'; to 300 dpi before printing, because you can't tell the difference above that resolution anyway. Most people would be quite happy with a 200 dpi print, so go ahead and crop a bit. If you get a print resolution too much below 200 dpi, you will start to see digital artifact in the print and it will be objectionable.



    -----



    So, if your goal is an excellent print with dots that are small enough that they are no longer distinguishable as individual dots without magnification, you need to print at 300 dpi. You can go down in resolution to 200 dpi and still have satisfcatory results. The resolution of 200 or 300 dpi is NOT a function of the camera beyond the degree that I have discussed above. It is determined by the software you are editting your pictures with and you usually have enough size to work with using any camera at or above 6 MP to get decent pictures.



    Working this out is easy once you understand the concept of print resolution. If you want 300 dpi, just do the math.



    4'; x 6';

    4 inches x 300 dots per inch = 1,200 dots

    6 inches x 300 dots per inch = 1,800 dots

    1,200 dots x 1,800 dots = 2,160,000 dots or 2.2 MP



    5'; x 7';

    5 inches x 300 dots per inch = 1,500 dots

    7 inches x 300 dots per inch = 2,100 dots

    1,500 dots x 2,100 dots = 3,150,000 dots or 3.2 MP



    8'; x 10';

    8 inches x 300 dots per inch = 2,400 dots

    10 inches x 300 dots per inch = 3,000 dots

    2,400 dots x 3,000 dots = 7,200,000 dots or 7.2 MP



    I will let you substitute 200 for 300 and do the math on these charts to see what the minimum acceptable resolutions for the various sizes would be.



    4'; x 6'; - 960,000

    5'; x 7'; - 1,400,000

    8'; x 10'; - 3,200,00How do I change picture settings on Sony Alpha 100?
    change the quality setting

    refer to manual to see how to set it
    You can't change that in-camera, nor should you be worried about it. The pixel count determines how much resolution you have. The DPI setting is just an instruction for your monitor or printer, that tells it how closely together to display those pixels.

    When you make/ order prints, you normally specify the desired size for your prints, and this automatically overrides the default setting of 72 dpi.

    The Sony A100 has a maximum resolution of 3872x2592 pixels. At 72dpi this would result in a 54x36 inch print! (3872 pixels / 72 dots per inch = 53.8 inches)

    At 300dpi, you get a 13x8.6 inch print.

    And if your prints are smaller than that, theoretically you're using a setting that's even higher than 300dpi.

    Change pictures to jpegs?

    i am trying to use my pictures to do something on pc ,it says they are jpeg but it wont accept them ,how do i check if they are jpeg and how can i change them if notChange pictures to jpegs?
    Easiest way is to right click on the photo from your CD or desktop and drag down to ';properties';. This will tell you what kind of file it is.



    If it is a .tif, a .gif. or a .btmp, you will need photosoftware, such as MAcromedia fireworks or Adobe Photoshop to convert to .jpg format.Change pictures to jpegs?
    Like previous answer, however you probably need something like an .eps or .pdf document. You should try the graphics programs you already have and choosing save as.
    You could try opening the picture using windows PAINT programme then click file and save as. Then were it say's save as change it to JPEG.
    some picture files you can open in windows paint and then save as .jpeg
    I use a freeware for a lot of my pics. It's called Irfanview. One of the features is to convert files to jpg.

    Another thing I do to make the file smaller is to cut down the number of unique colors from millions down to 256. Image looks the same ,but the file size cuts downsby 25% or more.
    right click mouse on pic

    click properties



    this tells you the format



    sometimes you can just type .jpg after the title and it changes it





    good luck
    To check if your image is definatly jpeg.

    Right click on the image go down to properties, and in the properties box it will tell you what type of image you have.

    If it is not a jpeg image, ( open the file in Ms paint or Photoshop and when it opens go to File, Save as, and in the save as type tab at the bottem select Jpeg, then save.

    Thats it

    See ya
    the easiest way i tried before was to open the picture. and then do a right click on the picture you have an option Save As... click on that it will ask for the location where you wanna save it.. at the bottom of the Location box you will have a drop down for file type, select .jpeg. then click save.

    it works for me.



    good luck!

    How can i change?? (pictures)?

    How can i physically change??? I'm so sick of my look and would like to freshen it up and make it chic.



    please give feedback



    http://tinypic.com/view.php?pic=6pnmte%26amp;s







    Please do not delete this because it is not ment to be a ' am i pretty question' but an actual question. This does not harm to anybody in the community. ThanksHow can i change?? (pictures)?
    i don't want to hurt your feelings and like i don't want to make you have low self esteem ok let me get to the point:

    1) new haircut

    2) new hairstyle

    3) wax eyebrows

    4) try mixing up clothes a little (pink top, skinny jeans,etc.)

    5) talk to your mom

    6) ask your friends

    7) change your personality (if it is mean, always angry, etc.)

    8) experiment with makeup

    9) experiment with straightening iron, curling iron, etc.

    10) wash your face (no offense)



    answer mine plz!:

    http://answers.yahoo.com/question/index;How can i change?? (pictures)?
    Well...

    an easy way to change is...

    new haircut

    new makeup

    new clothes
    Wax your brows.

    Let ur hair grow long and then cut it in layers

    Bye it a really dark brown

    Wear eyeliner, mascara, and gloss
    get loads of blonde highlights and cut it short
    hairstyle I guess
    You're stunningly beautiful, and you have profound grace.



    Why change something perfect?



    Like a rose, all flowers are perfect, and so are you.
    cosmetic surgery BELLA
    new haircut

    grow it out more then layer it

    more makeup, maybe if thats what ur looking for.

    and straighten ur hair ^^^

    it would look so cute!!
    Waxing your eyebrows, putting some makeup on (not a lot though), and straightening your hair
    eyebrows

    make up

    face wash

    grow ur hair out



    not being mean just answering ur question!
    Just a lil eye n lip makeup n start wearin short skirts - that should do it!
    Straighten your hair, and get layers. Then get side bangs to frame your face. Dye your hair a dark brown. (a color/cut like this: http://img174.imageshack.us/img174/2805/



    Make-up! Go with a natural look - a little blush, lip gloss, eyeliner, and mascara. If you want some light eyeshadow too.



    Wax your eyebrows.



    Good luck!
    Highlights in your hair and a different haircut. Black eyeliner. mascara and cover up and concealer,