I am looking for an answer as if we have DES having 64 bit key and we are encrypting an image it with ECB mode but it doesn't encrypt well. so if we change the key length then will it effect the output or not?
Increasing DES's key size (by using 3DES instead) won't mitigate at all the weaknesses of ECB mode. That's because the block size in unchanged, and the same identical blocks in plaintext will remain identical blocks in the ciphertext. See Wikipedia's illustration for what that can imply for raw bitmap images.
To some small degree, using a block cipher with a larger block size, such as AES, will give some level of mitigation (e.g. when enciphering a raw bitmap image, it will be less recognizable). But that's very partial (doubling the image's resolution will more than offset the mitigation).