-
AuthorPosts
-
giuse74 Friend
giuse74
- Join date:
- August 2013
- Posts:
- 18
- Downloads:
- 0
- Uploads:
- 1
- Thanked:
- 3 times in 1 posts
July 1, 2014 at 6:59 pm #199348I would like disable image grayscale to color in order to see images color directly.
How to do this?
Thanks.
Pankaj Sharma ModeratorPankaj Sharma
- Join date:
- February 2015
- Posts:
- 24589
- Downloads:
- 144
- Uploads:
- 202
- Thanks:
- 127
- Thanked:
- 4196 times in 4019 posts
July 2, 2014 at 3:56 am #540897<em>@giuse74 434816 wrote:</em><blockquote>I would like disable image grayscale to color in order to see images color directly.
How to do this?
</blockquote>
Do you want to disable it for a specific section of for the whole onepage .
Let me know i will help you solve thisgiuse74 Friendgiuse74
- Join date:
- August 2013
- Posts:
- 18
- Downloads:
- 0
- Uploads:
- 1
- Thanked:
- 3 times in 1 posts
July 2, 2014 at 7:41 am #540919I want to disable it for the whole onepage. Thanks
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
July 4, 2014 at 7:33 am #541165<em>@giuse74 434883 wrote:</em><blockquote>I want to disable it for the whole onepage. Thanks</blockquote>
Please try tweak below, it should help to disable image grayscale in JA Content Popup module.
Open the templates/ja_onepage/js/script.js file,
Change:
function Grayscale(image) {
if (supportsCanvas) {
$(image).jaload(function () {
var canvas = document.createElement('canvas'),
context = canvas.getContext('2d'),
imageData, px, length, i = 0, gray;canvas.width = image.naturalWidth ? image.naturalWidth : image.width;
canvas.height = image.naturalHeight ? image.naturalHeight : image.height;context.drawImage(image, 0, 0);
imageData = context.getImageData(0, 0, canvas.width, canvas.height);
px = imageData.data;
length = px.length;for (; i < length; i += 4) {
//gray = px * .3 + px * .59 + px * .11;
//px = px = px = gray;
px = px = px = (px + px + px) / 3;
}context.putImageData(imageData, 0, 0);
image.src = canvas.toDataURL();$(image).css('opacity', 0).animate({opacity: 1}, 500);
});
}
}
To:
function Grayscale(image) {
var supportsCanvas = false;
if (supportsCanvas) {
$(image).jaload(function () {
var canvas = document.createElement('canvas'),
context = canvas.getContext('2d'),
imageData, px, length, i = 0, gray;canvas.width = image.naturalWidth ? image.naturalWidth : image.width;
canvas.height = image.naturalHeight ? image.naturalHeight : image.height;context.drawImage(image, 0, 0);
imageData = context.getImageData(0, 0, canvas.width, canvas.height);
px = imageData.data;
length = px.length;for (; i < length; i += 4) {
//gray = px * .3 + px * .59 + px * .11;
//px = px = px = gray;
px = px = px = (px + px + px) / 3;
}context.putImageData(imageData, 0, 0);
image.src = canvas.toDataURL();$(image).css('opacity', 0).animate({opacity: 1}, 500);
});
}
} -
AuthorPosts
This topic contains 5 replies, has 3 voices, and was last updated by giuse74 10 years, 5 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum