Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Need help with pixel size

I'm trying to turn an image into 5000 of itself but I don't know the pixel size to put. I'm really sorry for posting here I tried looking it up on google but didn't know what to search :/. If anyone could help me I'd really appreciate it :).
Could you define this part: I'm trying to turn an image into 5000 of itself ?
I'm confused by "turn an image into 5000 of itself." Are you trying to expand an image's dimensions by 5000x? Are you trying to duplicate the same image over 5000x in one image?
Keep calm, chive on.
(Jan 30, 2017 01:53 PM)d4ne Wrote:  Could you define this part: I'm trying to turn an image into 5000 of itself ?
I'm trying to tile the image 5000 times. For example like I have an image I want to make 5000 of itself.
(Jan 30, 2017 01:54 PM)Orthoran Wrote:  I'm trying to tile the image 5000 times. For example like I have an image I want to make 5000 of itself.

So let's say you have a image inside a folder, now you want to duplicate the same image for 4999 times? So you would hava a folder containing 5000 pictures of the same piture?
(Jan 30, 2017 01:56 PM)d4ne Wrote:  So let's say you have a image inside a folder, now you want to duplicate the same image for 4999 times? So you would hava a folder containing 5000 pictures of the same piture?
Yes that's what I want to do.
(Jan 30, 2017 01:58 PM)Orthoran Wrote:  Yes that's what I want to do.

I'll code it quickly for u.
(Jan 30, 2017 02:00 PM)d4ne Wrote:  I'll code it quickly for u.
I just want the pixel size for 5000 images.
(Jan 30, 2017 02:03 PM)Orthoran Wrote:  I just want the pixel size for 5000 images.

Your confusing me, why would the picture pixel size change?
(Jan 30, 2017 02:08 PM)d4ne Wrote:  Your confusing me, why would the picture pixel size change?
I just want to make 4999 copies of an image on the same editor canvas.
(Jan 30, 2017 02:16 PM)Orthoran Wrote:  I just want to make 4999 copies of an image on the same editor canvas.

Assuming this question is JS based since your talking about canvas.

Then you have to get the height, width of the image itself first: http://jsfiddle.net/jjUHs/
Then calculate the new height, width in the following way: old width 4999 and old height 4999 which would be insanely big.

So i don't think thats a good idea. The resource would take ages to load.
Actually it's ok I'll figure it out myself. But thanks for helping me :).
(Jan 30, 2017 02:30 PM)Orthoran Wrote:  Actually it's ok I'll figure it out myself. But thanks for helping me :).

Javascript way:

Code
var img = document.getElementById('imageid');
var width = img.clientWidth * 4999;
var height = img.clientHeight * 4999;

Or dev console response:

Code
function new_image(url) {
   var img         = new Image();
   img.crossOrigin = 'anonymous';
   img.src         = url;
   return img;
}

function img_ready(img, callback) {
   if ( img.complete && img.width > 0 && img.height > 0 ) {
      callback();
   }
   else {
      window.setTimeout(function() {
         img_ready(img, callback);
      }, 100);
   }
}

var img = new_image('https://i.imgur.com/elvNYax.jpg');
img_ready(img, function() {
   var width  = (img.width * 4999);
   var height = (img.height * 4999);
   console.log(width + 'x' + height);
})
I believe OP wants something like this. I don't know how to do it but I think you didn't understand him.
Spoiler (Click to View)



Possibly Related Threads...
Thread / Author Replies Views Last Post
by glasspJun 13, 2017 01:02 AM 6 558 Jun 13, 2017 01:02 AM
Last Post: rudel777
by Gucci_Apr 9, 2016 12:09 PM 4 197 Apr 9, 2016 12:09 PM
Last Post: Gucci_
by unknown321Jun 11, 2015 08:30 PM 1 294 Jun 11, 2015 08:30 PM
Last Post: Compulsive