I am trying to increase customer login page capcha size(width,height) programmatically magento 2?


Try this way.

For that you need to override below file to your theme or custom module.


You can find code like this.

<div class="control captcha-image">
    <img alt="<?= $block->escapeHtmlAttr(__('Please type the letters and numbers below')) ?>" class="captcha-img" height="<?= /* @noEscape */ (float) $block->getImgHeight() ?>" src="<?= $block->escapeUrl($captcha->getImgSrc()) ?>"z/>
    <button type="button" class="action reload captcha-reload" title="<?= $block->escapeHtmlAttr(__('Reload captcha')) ?>"><span><?= $block->escapeHtml(__('Reload captcha')) ?></span></button>

In <img> field You can add custom width & height to inline.

I hope it works!.

  • its worked but capcha image size increasing with blurs ie the problem is there any way to increase original image size – Hitesh Balpande Oct 18 '18 at 11:56
  • @hiteshbalpande let me check if found solution for that. – Chirag Patel Oct 18 '18 at 12:18
  • ok chirag i am also trying – Hitesh Balpande Oct 18 '18 at 12:24

Hi solution is here with proper resolution.

Override below file to your theme.


Add below css to your default.phtml at the bottom.

<style type="text/css">
.control.captcha-image .captcha-img {transform:scale(1.2);-webkit-transform:scale(1.2);transform-origin:0 0;-webkit-transform-origin:0 0;}
button.action.reload{margin-left: 50px;}

I would recommend disabling default captcha and implementing Google reCaptcha as it's very simple to implement, reliable and simple to use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.